aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/app/_services/auth.service.ts
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/src/app/_services/auth.service.ts')
-rw-r--r--frontend/src/app/_services/auth.service.ts3
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();
}
}