diff --git a/angular-oauth2-oidc/src/interceptors/default-oauth.interceptor.ts b/angular-oauth2-oidc/src/interceptors/default-oauth.interceptor.ts index a5d62a6a..872f0896 100644 --- a/angular-oauth2-oidc/src/interceptors/default-oauth.interceptor.ts +++ b/angular-oauth2-oidc/src/interceptors/default-oauth.interceptor.ts @@ -10,12 +10,14 @@ import { OAuthModuleConfig } from "../oauth-module.config"; @Injectable() export class DefaultOAuthInterceptor implements HttpInterceptor { - + private authStorage: OAuthStorage; + constructor( - private authStorage: OAuthStorage, + authService: OAuthService, private errorHandler: OAuthResourceServerErrorHandler, @Optional() private moduleConfig: OAuthModuleConfig ) { + this.authStorage = authService.getStorage(); } private checkUrl(url: string): boolean { diff --git a/angular-oauth2-oidc/src/oauth-service.ts b/angular-oauth2-oidc/src/oauth-service.ts index 17847937..db115448 100644 --- a/angular-oauth2-oidc/src/oauth-service.ts +++ b/angular-oauth2-oidc/src/oauth-service.ts @@ -22,7 +22,6 @@ export class OAuthService // extending AuthConfig ist just for LEGACY reasons // to not break existing code - /** * The ValidationHandler used to validate received * id_tokens. @@ -312,6 +311,10 @@ export class OAuthService this._storage = storage; this.configChanged(); } + + public getStorage(): OAuthStorage { + return this._storage; + } /** * Loads the discovery document to configure most @@ -462,7 +465,6 @@ export class OAuthService } // this.sessionChecksEnabled = !!doc.check_session_iframe; - return true; } @@ -1138,7 +1140,6 @@ export class OAuthService } */ // let nonceInState = stateParts[0]; - if (this.requestAccessToken && !options.disableOAuth2StateCheck) { let success = this.validateNonceForAccessToken(accessToken, nonceInState); if (!success) { @@ -1546,4 +1547,4 @@ export class OAuthService return this.tokenValidationHandler.validateSignature(params); } -} +} \ No newline at end of file