Skip to content

Commit

Permalink
Chore: app migration (#3069)
Browse files Browse the repository at this point in the history
  • Loading branch information
thewahome authored and musale committed Jan 2, 2025
1 parent af1f672 commit 94b213f
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions src/modules/authentication/AuthenticationWrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 94b213f

Please sign in to comment.