mirror of
https://github.com/friendica/friendica
synced 2025-04-24 01:10:11 +00:00
Support OAuth for the legacy API
This commit is contained in:
parent
86d56c7f57
commit
9c59bcb6a5
2 changed files with 10 additions and 1 deletions
|
@ -238,7 +238,7 @@ class BaseApi extends BaseModule
|
|||
*
|
||||
* @return int User ID
|
||||
*/
|
||||
protected static function getCurrentUserID()
|
||||
public static function getCurrentUserID(bool $nologin = false)
|
||||
{
|
||||
if (empty(self::$current_user_id)) {
|
||||
self::$current_token = self::getTokenByBearer();
|
||||
|
@ -247,7 +247,10 @@ class BaseApi extends BaseModule
|
|||
} else {
|
||||
self::$current_user_id = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if ($nologin) {
|
||||
return (int)self::$current_user_id;
|
||||
}
|
||||
|
||||
if (empty(self::$current_user_id)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue