Skip to content

Commit

Permalink
Start token refresh when token arrives to expire
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohamed Hamou authored and Mohamed Hamou committed Feb 19, 2024
1 parent 4040514 commit 606eee2
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ export class ArlasIamService extends ArlasAuthentificationService {
// todo: !! attention if the token expires in less than one minute !
// refresh accessToken when timeout ended (passing the refreshToken)
// start the delay after 0 seconds
this.refreshTokenTimer$ = timer(0, timeout).pipe(takeUntil(this.unsubscribe)).subscribe(() => {
this.refreshTokenTimer$ = timer(timeout, timeout).pipe(takeUntil(this.unsubscribe)).subscribe(() => {
const newestRefreshToken = this.getRefreshToken();
this.refresh(newestRefreshToken.value).subscribe({
next: (loginData: LoginData) => {
Expand Down

0 comments on commit 606eee2

Please sign in to comment.