Skip to content

Commit

Permalink
Merge pull request #1259 from mahmut-gundogdu/issue/1258
Browse files Browse the repository at this point in the history
add max value on calcTimeout function
  • Loading branch information
manfredsteyer authored Nov 18, 2022
2 parents ae19d9a + e2fe6a4 commit 48e53b9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion projects/lib/src/oauth-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down

0 comments on commit 48e53b9

Please sign in to comment.