diff --git a/src/app/user/controllers/UserController.php b/src/app/user/controllers/UserController.php index a98ac0f66d8484856ef9f7aed72982d8a0f74050..cffdeb0acec66c5494f0c5147dc30737ddd73879 100755 --- a/src/app/user/controllers/UserController.php +++ b/src/app/user/controllers/UserController.php @@ -768,6 +768,7 @@ class UserController try { $jwt = AuthenticationModel::decodeToken($body['token'], CoreConfigModel::getEncryptKey()); + $jwt['user'] = (array)$jwt['user'] ?? []; } catch (\Exception $e) { return $response->withStatus(403)->withJson(['errors' => 'Invalid token', 'lang' => 'invalidToken']); } diff --git a/src/core/controllers/AuthenticationController.php b/src/core/controllers/AuthenticationController.php index e92e6adba5f37237682a0551ed0fc289c58966fe..1df635b98bb926a3ae6a143e32657570fb999796 100755 --- a/src/core/controllers/AuthenticationController.php +++ b/src/core/controllers/AuthenticationController.php @@ -364,6 +364,7 @@ class AuthenticationController try { $jwt = AuthenticationModel::decodeToken($queryParams['refreshToken'], CoreConfigModel::getEncryptKey()); + $jwt['user'] = (array)$jwt['user'] ?? []; } catch (\Exception $e) { return $response->withStatus(401)->withJson(['errors' => 'Authentication Failed']); }