Skip to content

Commit 9ed3cd6

Browse files
Merge pull request #369 from reenhanced/nh-openuri
Properly implements openUri for implicit flow
2 parents 4cf10bb + 7c6cfed commit 9ed3cd6

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

projects/lib/src/oauth-service.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,6 @@ export class OAuthService extends AuthConfig implements OnDestroy {
373373
*
374374
* { provide: OAuthStorage, useFactory: oAuthStorageFactory }
375375
* export function oAuthStorageFactory(): OAuthStorage { return localStorage; }
376-
*
377376
* Sets a custom storage used to store the received
378377
* tokens on client side. By default, the browser's
379378
* sessionStorage is used.
@@ -1262,9 +1261,7 @@ export class OAuthService extends AuthConfig implements OnDestroy {
12621261
}
12631262

12641263
this.createLoginUrl(additionalState, loginHint, null, false, addParams)
1265-
.then(function (url) {
1266-
location.href = url;
1267-
})
1264+
.then(this.config.openUri)
12681265
.catch(error => {
12691266
console.error('Error in initImplicitFlow', error);
12701267
this.inImplicitFlow = false;
@@ -1840,7 +1837,7 @@ export class OAuthService extends AuthConfig implements OnDestroy {
18401837
(this.logoutUrl.indexOf('?') > -1 ? '&' : '?') +
18411838
params.toString();
18421839
}
1843-
location.href = logoutUrl;
1840+
this.config.openUri(logoutUrl);
18441841
}
18451842

18461843
/**

0 commit comments

Comments
 (0)