diff options
author | Nevena Bojovic <nenabojov@gmail.com> | 2022-03-19 22:38:34 +0100 |
---|---|---|
committer | Nevena Bojovic <nenabojov@gmail.com> | 2022-03-19 22:38:34 +0100 |
commit | 5f40d4a21a09b481343f894eab7970de895744d7 (patch) | |
tree | 3fcfaca394e9a9586bf944c389ffc4e907ec2664 /frontend/src/app/_services/auth.service.ts | |
parent | 347ce115be33fce7ce3bd7a91e240f8f4e3fb901 (diff) | |
parent | ff5bf81a14d3024f8ff1764db488dec6790ed37e (diff) |
Merge branch 'dev' of http://gitlab.pmf.kg.ac.rs/igrannonica/neuronstellar into dev
Diffstat (limited to 'frontend/src/app/_services/auth.service.ts')
-rw-r--r-- | frontend/src/app/_services/auth.service.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/frontend/src/app/_services/auth.service.ts b/frontend/src/app/_services/auth.service.ts index afc1567b..20ff45f3 100644 --- a/frontend/src/app/_services/auth.service.ts +++ b/frontend/src/app/_services/auth.service.ts @@ -46,7 +46,7 @@ export class AuthService { this.http.post(`${API_SETTINGS.apiURL}/auth/renewJwt`, {}, { headers: this.authHeader(), responseType: 'text' }).subscribe((response) => { this.authenticate(response); }); - }, exp.getTime() - new Date().getTime()); + }, exp.getTime() - new Date().getTime() - 60000); } authenticate(token: string) { @@ -62,6 +62,7 @@ export class AuthService { if (this.cookie.check('token')) { const token = this.cookie.get('token'); this.shared.loggedIn = this.isAuthenticated(); + this.shared.username = jwtHelper.decodeToken(token).name; this.enableAutoRefresh(); } } |