From 7feca766f5833f9e5e2d310d2767d6a4a97cd928 Mon Sep 17 00:00:00 2001 From: ahaslehurst Date: Thu, 31 Oct 2019 12:55:12 +0000 Subject: [PATCH] Fixed not using config.openUri in code flow --- projects/lib/src/oauth-service.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/projects/lib/src/oauth-service.ts b/projects/lib/src/oauth-service.ts index 2b9de9dc..884c505a 100644 --- a/projects/lib/src/oauth-service.ts +++ b/projects/lib/src/oauth-service.ts @@ -2168,13 +2168,12 @@ export class OAuthService extends AuthConfig implements OnDestroy { throw new Error('loginUrl must use Http. Also check property requireHttps.'); } - this.createLoginUrl(additionalState, '', null, false, params).then(function (url) { - location.href = url; - }) - .catch(error => { - console.error('Error in initAuthorizationCodeFlow'); - console.error(error); - }); + this.createLoginUrl(additionalState, '', null, false, params) + .then(this.config.openUri) + .catch(error => { + console.error('Error in initAuthorizationCodeFlow'); + console.error(error); + }); } protected async createChallangeVerifierPairForPKCE(): Promise<[string, string]> {