From 541f173004ad2df8b0a1b3cb4709295beb3eb327 Mon Sep 17 00:00:00 2001 From: Sergey Gryshchenko Date: Fri, 23 Jun 2023 20:16:25 +0300 Subject: [PATCH] add params to initLoginFlowInPopup --- projects/lib/src/oauth-service.ts | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/projects/lib/src/oauth-service.ts b/projects/lib/src/oauth-service.ts index b241adc5..d65cacbc 100644 --- a/projects/lib/src/oauth-service.ts +++ b/projects/lib/src/oauth-service.ts @@ -1146,16 +1146,24 @@ export class OAuthService extends AuthConfig implements OnDestroy { height?: number; width?: number; windowRef?: Window; + params?: string | object }) { options = options || {}; + + let addParams: object = {}; + let loginHint: string = null; + if (typeof options.params === 'string') { + loginHint = options.params; + } else if (typeof options.params === 'object') { + addParams = options.params; + } + addParams['display'] = 'popup'; return this.createLoginUrl( null, - null, + loginHint, this.silentRefreshRedirectUri, false, - { - display: 'popup', - } + addParams ).then((url) => { return new Promise((resolve, reject) => { /**