In my example the token expires in ~37000 seconds but the timer is triggered every ~37 seconds
So i think it should be something like this:
this.loginRefreshTimer = timer((exp - this.now() - 300) * 1000).subscribe((x) => { this.refreshLoginToken() });
You calculate the interval with 'exp - this.now() - 300' which are seconds. But the rxjs timer requires milliseconds as interval time.
this.loginRefreshTimer = timer(exp - this.now() - 300).subscribe((x) => { this.refreshLoginToken() });
In my example the token expires in ~37000 seconds but the timer is triggered every ~37 seconds
So i think it should be something like this:
this.loginRefreshTimer = timer((exp - this.now() - 300) * 1000).subscribe((x) => { this.refreshLoginToken() });