From 7254e40c01c152f76619b9a7a91d13c618fb8080 Mon Sep 17 00:00:00 2001 From: Sebastian Saip Date: Mon, 14 Mar 2022 15:22:14 +0100 Subject: [PATCH 1/2] disableNonceCheck always leads to an error #1210 --- projects/lib/src/oauth-service.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/projects/lib/src/oauth-service.ts b/projects/lib/src/oauth-service.ts index a5fbfd14..523996aa 100644 --- a/projects/lib/src/oauth-service.ts +++ b/projects/lib/src/oauth-service.ts @@ -1785,16 +1785,16 @@ export class OAuthService extends AuthConfig implements OnDestroy { return Promise.reject(event); } } + } - this.storeSessionState(sessionState); + this.storeSessionState(sessionState); - if (code) { - await this.getTokenFromCode(code, options); - this.restoreRequestedRoute(); - return Promise.resolve(); - } else { - return Promise.resolve(); - } + if (code) { + await this.getTokenFromCode(code, options); + this.restoreRequestedRoute(); + return Promise.resolve(); + } else { + return Promise.resolve(); } return Promise.reject(); From e2fe6a414ba060a216f9b713c5fa8ac5ee021880 Mon Sep 17 00:00:00 2001 From: Mahmut Gundogdu Date: Mon, 26 Sep 2022 17:09:47 +0300 Subject: [PATCH 2/2] add max value on calcTimeout function --- projects/lib/src/oauth-service.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/projects/lib/src/oauth-service.ts b/projects/lib/src/oauth-service.ts index a5fbfd14..8d08c006 100644 --- a/projects/lib/src/oauth-service.ts +++ b/projects/lib/src/oauth-service.ts @@ -495,7 +495,9 @@ export class OAuthService extends AuthConfig implements OnDestroy { const now = this.dateTimeService.now(); const delta = (expiration - storedAt) * this.timeoutFactor - (now - storedAt); - return Math.max(0, delta); + const duration = Math.max(0, delta); + const maxTimeoutValue = 2_147_483_647; + return duration > maxTimeoutValue ? maxTimeoutValue : duration; } /**