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.ts7
1 files changed, 4 insertions, 3 deletions
diff --git a/frontend/src/app/_services/auth.service.ts b/frontend/src/app/_services/auth.service.ts
index ef340684..dd46615d 100644
--- a/frontend/src/app/_services/auth.service.ts
+++ b/frontend/src/app/_services/auth.service.ts
@@ -1,9 +1,9 @@
-import { Injectable } from '@angular/core';
+import { EventEmitter, Injectable } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { JwtHelperService } from '@auth0/angular-jwt';
import { CookieService } from 'ngx-cookie-service';
import shared from '../Shared';
-import { Configuration } from '../configuration.service';
+import { Configuration } from './configuration.service';
const jwtHelper = new JwtHelperService();
@@ -13,6 +13,7 @@ const jwtHelper = new JwtHelperService();
export class AuthService {
shared = shared;
+ public loggedInEvent: EventEmitter<boolean> = new EventEmitter();
constructor(private http: HttpClient, private cookie: CookieService) { }
@@ -52,7 +53,7 @@ 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);