Skip to content

Commit 53865ae

Browse files
committed
Fixes manfredsteyer#1318 by multiplying decreaseExpirationBySec with 1000. Also fixes wrong subtraction of getClockSkewInMsec
Signed-off-by: Patrick Bender <[email protected]>
1 parent 3ba7303 commit 53865ae

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

projects/lib/src/oauth-service.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -2268,7 +2268,7 @@ export class OAuthService extends AuthConfig implements OnDestroy {
22682268

22692269
if (
22702270
issuedAtMSec - clockSkewInMSec >= now ||
2271-
expiresAtMSec + clockSkewInMSec - this.decreaseExpirationBySec <= now
2271+
expiresAtMSec + clockSkewInMSec - this.decreaseExpirationBySec * 1000 <= now
22722272
) {
22732273
const err = 'Token has expired';
22742274
console.error(err);
@@ -2424,8 +2424,7 @@ export class OAuthService extends AuthConfig implements OnDestroy {
24242424
const now = this.dateTimeService.new();
24252425
if (
24262426
expiresAt &&
2427-
parseInt(expiresAt, 10) - this.decreaseExpirationBySec <
2428-
now.getTime() - this.getClockSkewInMsec()
2427+
parseInt(expiresAt, 10) - this.decreaseExpirationBySec * 1000 < now.getTime()
24292428
) {
24302429
return false;
24312430
}

0 commit comments

Comments
 (0)