From 0e5aaf6d3976b9a46b48f554d004f3b90ca8b813 Mon Sep 17 00:00:00 2001 From: Ognjen Cirkovic Date: Sat, 30 Apr 2022 19:45:20 +0200 Subject: Omoguceno na frontu da se guestu refresha token. --- frontend/src/app/_services/auth.service.ts | 10 +--------- frontend/src/app/app.component.ts | 2 +- 2 files changed, 2 insertions(+), 10 deletions(-) (limited to 'frontend/src/app') diff --git a/frontend/src/app/_services/auth.service.ts b/frontend/src/app/_services/auth.service.ts index 845cb3f5..92920b24 100644 --- a/frontend/src/app/_services/auth.service.ts +++ b/frontend/src/app/_services/auth.service.ts @@ -52,21 +52,13 @@ export class AuthService { } var property = jwtHelper.decodeToken(this.cookie.get('token')); var username = property['name']; - if (username != "") { this.refresher = setTimeout(() => { this.http.post(`${Configuration.settings.apiURL}/auth/renewJwt`, {}, { headers: this.authHeader(), responseType: 'text' }).subscribe((response) => { this.authenticate(response); }); }, exp.getTime() - new Date().getTime() - 60000); - } - else { - this.refresher = setTimeout(() => { - this.getGuestToken().subscribe((response) => { - this.authenticate(response); - }); - }, exp.getTime() - new Date().getTime() - 60000); - } + } addGuestToken() { diff --git a/frontend/src/app/app.component.ts b/frontend/src/app/app.component.ts index e301b46f..dfe4febc 100644 --- a/frontend/src/app/app.component.ts +++ b/frontend/src/app/app.component.ts @@ -43,7 +43,7 @@ export class AppComponent implements OnInit, AfterViewInit { if(!this.authService.alreadyGuest()) this.authService.addGuestToken(); } - this.signalRService.startConnection(); + //this.signalRService.startConnection(); //this.startHttpRequest(); } } -- cgit v1.2.3