Skip to content
Snippets Groups Projects
Commit adae8870 authored by Guillaume Heurtier's avatar Guillaume Heurtier
Browse files

FEAT #14566 TIME 0:35 added connection method to token

parent 1713dbb2
No related branches found
No related tags found
No related merge requests found
......@@ -253,8 +253,9 @@ class AuthenticationController
unset($user['picture']);
$token = [
'exp' => time() + 60 * $sessionTime,
'user' => $user
'exp' => time() + 60 * $sessionTime,
'user' => $user,
'connection' => ConfigurationModel::getConnection()
];
$jwt = JWT::encode($token, CoreConfigModel::getEncryptKey());
......@@ -291,7 +292,8 @@ class AuthenticationController
'exp' => time() + 3600,
'user' => [
'id' => $GLOBALS['id']
]
],
'connection' => ConfigurationModel::getConnection()
];
$jwt = JWT::encode($token, CoreConfigModel::getEncryptKey());
......
......@@ -63,7 +63,10 @@ export class AuthService {
updateUserInfo(token: string) {
const currentPicture = this.user.picture;
this.user = JSON.parse(atob(token.split('.')[1])).user;
const tokenData = JSON.parse(atob(token.split('.')[1]));
this.user = tokenData.user;
this.authMode = tokenData.connection;
this.user.picture = currentPicture;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment