aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/app/_services/auth.service.ts
diff options
context:
space:
mode:
authorDanijel Andjelkovic <adanijel99@gmail.com>2022-03-17 00:32:49 +0100
committerDanijel Andjelkovic <adanijel99@gmail.com>2022-03-17 00:32:49 +0100
commite22b83919e6442dfb55d7953d9227268c850adf8 (patch)
treeca922587fd336293b4af2ecf2a61d47bd6d1dfd1 /frontend/src/app/_services/auth.service.ts
parenteceb0d7b3623646875b0ca34162fb619a455af15 (diff)
Napravio neophodne izmene tako da backend i frontend komuniciraju uspesno.
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();
}
}