From 94b213f0e0e9d80c95fe8b951c65205632558b52 Mon Sep 17 00:00:00 2001 From: Charles Wahome Date: Wed, 27 Mar 2024 14:19:06 +0300 Subject: [PATCH] Chore: app migration (#3069) --- .../authentication/AuthenticationWrapper.ts | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/src/modules/authentication/AuthenticationWrapper.ts b/src/modules/authentication/AuthenticationWrapper.ts index a6b338f4f..dfd95f375 100644 --- a/src/modules/authentication/AuthenticationWrapper.ts +++ b/src/modules/authentication/AuthenticationWrapper.ts @@ -35,6 +35,18 @@ export class AuthenticationWrapper implements IAuthenticationWrapper { selectedVersion: '', sampleHeaders: [] }; + private extraQueryParameters: { [key: string]: string } = (() => { + const params: { [key: string]: string } = { + mkt: geLocale + }; + + const migrationParam = process.env.REACT_APP_MIGRATION_PARAMETER; + if (migrationParam) { + params.MigrationQueryParam = migrationParam; + } + + return params; + })(); public static getInstance(): AuthenticationWrapper { if (!AuthenticationWrapper.instance) { @@ -76,8 +88,7 @@ export class AuthenticationWrapper implements IAuthenticationWrapper { authority: this.getAuthority(), prompt: 'select_account', redirectUri: getCurrentUri(), - extraQueryParameters: getExtraQueryParameters(), - tokenQueryParameters: getExtraQueryParameters() + extraQueryParameters: this.extraQueryParameters }; try { const result = await msalApplication.loginPopup(popUpRequest); @@ -208,10 +219,10 @@ export class AuthenticationWrapper implements IAuthenticationWrapper { authority: this.getAuthority(), prompt: 'select_account', redirectUri: getCurrentUri(), - claims: this.getClaims(), - extraQueryParameters: getExtraQueryParameters(), - tokenQueryParameters: getExtraQueryParameters() + extraQueryParameters: this.extraQueryParameters, + claims: this.getClaims() }; + console.log('popUpRequest', popUpRequest) if (this.consentingToNewScopes || this.performingStepUpAuth) { delete popUpRequest.prompt;