diff --git a/rest/index.php b/rest/index.php index cf0d013c4382139592342df50216618e43f7dfb6..0472aca69ff5332a2f2b968a759c657572bd26dc 100755 --- a/rest/index.php +++ b/rest/index.php @@ -50,6 +50,7 @@ $app->add(function (\Slim\Http\Request $request, \Slim\Http\Response $response, //Authentication $app->get('/authenticationInformations', \SrcCore\controllers\AuthenticationController::class . ':getInformations'); $app->post('/authenticate', \SrcCore\controllers\AuthenticationController::class . ':authenticate'); +$app->get('/authenticate/token', \SrcCore\controllers\AuthenticationController::class . ':getRefreshedToken'); //Attachments $app->get('/attachments/{id}', \Attachment\controllers\AttachmentController::class . ':getById'); diff --git a/src/core/controllers/AuthenticationController.php b/src/core/controllers/AuthenticationController.php index 8741f2ed6b765776ceccf7159490ccce7e492854..0e4d657bf3832028730f1ffca9f9a88007af5bec 100755 --- a/src/core/controllers/AuthenticationController.php +++ b/src/core/controllers/AuthenticationController.php @@ -122,7 +122,7 @@ class AuthenticationController $GLOBALS['id'] = $user['id']; - $user['refresh_token'] = json_decode($user['refresh_token']); + $user['refresh_token'] = json_decode($user['refresh_token'], true); foreach ($user['refresh_token'] as $key => $refreshToken) { try { JWT::decode($refreshToken, CoreConfigModel::getEncryptKey(), ['HS256']);