aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/app
diff options
context:
space:
mode:
authorNevena Bojovic <nenabojov@gmail.com>2022-04-16 22:23:32 +0200
committerNevena Bojovic <nenabojov@gmail.com>2022-04-16 22:23:32 +0200
commit4479ad2de0c64280c61bea72bdb501e31aeb5d21 (patch)
tree437aac2d7bdc022f60d43855a91f4d4f90814099 /frontend/src/app
parent1849a275864cdd7d70e284127360fa211ad470d7 (diff)
parent97a6e3ace33b7b0617514dbc38a7b1dee1008cb8 (diff)
Merge branch 'dev' of http://gitlab.pmf.kg.ac.rs/igrannonica/neuronstellar into dev
Diffstat (limited to 'frontend/src/app')
-rw-r--r--frontend/src/app/_services/auth.service.ts2
1 files changed, 2 insertions, 0 deletions
diff --git a/frontend/src/app/_services/auth.service.ts b/frontend/src/app/_services/auth.service.ts
index 92cebe7f..ef340684 100644
--- a/frontend/src/app/_services/auth.service.ts
+++ b/frontend/src/app/_services/auth.service.ts
@@ -44,6 +44,7 @@ export class AuthService {
enableAutoRefresh() {
this.lastToken = this.cookie.get('token');
+ clearTimeout(this.refresher);
let exp = jwtHelper.getTokenExpirationDate(this.lastToken);
if (!exp) {
exp = new Date();
@@ -51,6 +52,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);