Merge pull request #10367 from annando/old-api-oauth

Support OAuth for the legacy API
This commit is contained in:
Tobias Diekershoff
2021-06-03 06:36:03 +02:00
committed by GitHub
2 changed files with 10 additions and 1 deletions
+4 -1
View File
@@ -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)) {