Skip to content

Commit

Permalink
Simply reload
Browse files Browse the repository at this point in the history
  • Loading branch information
loicgasser committed Jul 13, 2020
1 parent 548a85a commit 42f4388
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions jwt-angular/src/app/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,7 @@ export class AuthService {
console.log('redirect user to login');
// in a real app you would redirect the user to the login page
} else if (event.key === 'signin') {
this.refreshToken()
.subscribe(() => {
console.log('sync sign in');
window.location.reload();
});
window.location.reload();
}
}

Expand All @@ -135,6 +131,7 @@ export class AuthService {
const accessExpiry = moment(this.accessExpiry - 1000);
const timeToWait = accessExpiry.diff(now, 'second') * 1000;

this.cancelRefresh();
this.scheduledRefreshSub = of(null)
.pipe(delay(timeToWait))
.subscribe(() => {
Expand Down

0 comments on commit 42f4388

Please sign in to comment.