Merged in bugfix/PMCORE-3422 (pull request #8262)

PMCORE-3422

Approved-by: Julio Cesar Laura Avendaño
This commit is contained in:
Paula Quispe
2021-11-05 14:57:15 +00:00
committed by Julio Cesar Laura Avendaño

View File

@@ -346,7 +346,7 @@ class Server implements iAuthenticate
$request = \OAuth2\Request::createFromGlobals(); $request = \OAuth2\Request::createFromGlobals();
$allowed = $this->server->verifyResourceRequest($request); $allowed = $this->server->verifyResourceRequest($request);
$token = $this->server->getAccessTokenData($request); $token = $this->server->getAccessTokenData($request);
self::$userId = $token['user_id']; self::$userId = !empty($token['user_id']) ? $token['user_id'] : '';
// Session handling to prevent session lose in other places like, home, admin, etc // Session handling to prevent session lose in other places like, home, admin, etc
// when user is using the new designer that have not session because it is using only the API // when user is using the new designer that have not session because it is using only the API
@@ -392,7 +392,7 @@ class Server implements iAuthenticate
->setSkin(SYS_SKIN) ->setSkin(SYS_SKIN)
->setLanguage(SYS_LANG); ->setLanguage(SYS_LANG);
if ($token['client_id'] === config('oauthClients.mobile.clientId')) { if (!empty($token['client_id']) && $token['client_id'] === config('oauthClients.mobile.clientId')) {
ChangeLog::getChangeLog() ChangeLog::getChangeLog()
->setSourceId(ChangeLog::FromMobile); ->setSourceId(ChangeLog::FromMobile);
} else { } else {