diff --git a/projects/lib/src/oauth-service.ts b/projects/lib/src/oauth-service.ts index f3c65e5f..c1fef997 100644 --- a/projects/lib/src/oauth-service.ts +++ b/projects/lib/src/oauth-service.ts @@ -373,7 +373,6 @@ export class OAuthService extends AuthConfig implements OnDestroy { * * { provide: OAuthStorage, useFactory: oAuthStorageFactory } * export function oAuthStorageFactory(): OAuthStorage { return localStorage; } - * * Sets a custom storage used to store the received * tokens on client side. By default, the browser's * sessionStorage is used. @@ -1262,9 +1261,7 @@ export class OAuthService extends AuthConfig implements OnDestroy { } this.createLoginUrl(additionalState, loginHint, null, false, addParams) - .then(function (url) { - location.href = url; - }) + .then(this.config.openUri) .catch(error => { console.error('Error in initImplicitFlow', error); this.inImplicitFlow = false; @@ -1840,7 +1837,7 @@ export class OAuthService extends AuthConfig implements OnDestroy { (this.logoutUrl.indexOf('?') > -1 ? '&' : '?') + params.toString(); } - location.href = logoutUrl; + this.config.openUri(logoutUrl); } /**