Browse Source
Merge pull request #14140 from abpframework/improve/TimeoutLimitedOAuthService
use result of super function. do not dublicate
pull/14141/head
Muhammed Altuğ
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
1 additions and
3 deletions
-
npm/ng-packs/packages/core/src/lib/services/timeout-limited-oauth.service.ts
|
|
|
@ -4,9 +4,7 @@ import { OAuthService } from 'angular-oauth2-oidc'; |
|
|
|
@Injectable() |
|
|
|
export class TimeoutLimitedOAuthService extends OAuthService { |
|
|
|
protected override calcTimeout(storedAt: number, expiration: number): number { |
|
|
|
const now = this.dateTimeService.now(); |
|
|
|
const delta = (expiration - storedAt) * this.timeoutFactor - (now - storedAt); |
|
|
|
const result = Math.max(0, delta); |
|
|
|
const result = super.calcTimeout(storedAt, expiration); |
|
|
|
const MAX_TIMEOUT_DURATION = 2147483647; |
|
|
|
return result < MAX_TIMEOUT_DURATION ? result : MAX_TIMEOUT_DURATION - 1; |
|
|
|
} |
|
|
|
|