@@ -11,13 +11,15 @@ import {
1111 DEFAULT_USER_SCOPES ,
1212 HOME_ACCOUNT_KEY
1313} from '../../app/services/graph-constants' ;
14- import { signInAuthError } from './authentication-error-hints' ;
14+ import { SAFEROLLOUTACTIVE } from '../../app/services/variant-constants' ;
15+ import variantService from '../../app/services/variant-service' ;
1516import { geLocale } from '../../appLocale' ;
17+ import { IQuery } from '../../types/query-runner' ;
18+ import { ClaimsChallenge } from './ClaimsChallenge' ;
1619import { getCurrentUri } from './authUtils' ;
20+ import { signInAuthError } from './authentication-error-hints' ;
1721import IAuthenticationWrapper from './interfaces/IAuthenticationWrapper' ;
1822import { msalApplication } from './msal-app' ;
19- import { IQuery } from '../../types/query-runner' ;
20- import { ClaimsChallenge } from './ClaimsChallenge' ;
2123
2224const defaultScopes = DEFAULT_USER_SCOPES . split ( ' ' ) ;
2325
@@ -73,7 +75,7 @@ export class AuthenticationWrapper implements IAuthenticationWrapper {
7375 authority : this . getAuthority ( ) ,
7476 prompt : 'select_account' ,
7577 redirectUri : getCurrentUri ( ) ,
76- extraQueryParameters : { mkt : geLocale }
78+ extraQueryParameters : getExtraQueryParameters ( )
7779 } ;
7880 try {
7981 const result = await msalApplication . loginPopup ( popUpRequest ) ;
@@ -205,7 +207,7 @@ export class AuthenticationWrapper implements IAuthenticationWrapper {
205207 authority : this . getAuthority ( ) ,
206208 prompt : 'select_account' ,
207209 redirectUri : getCurrentUri ( ) ,
208- extraQueryParameters : { mkt : geLocale } ,
210+ extraQueryParameters : getExtraQueryParameters ( ) ,
209211 claims : this . getClaims ( )
210212 } ;
211213
@@ -297,3 +299,20 @@ export class AuthenticationWrapper implements IAuthenticationWrapper {
297299 window . sessionStorage . clear ( ) ;
298300 }
299301}
302+
303+ function getExtraQueryParameters ( ) : { [ key : string ] : string } {
304+ const params : { [ key : string ] : string } = {
305+ mkt : geLocale
306+ } ;
307+ getSafeRolloutParameter ( params ) ;
308+ return params ;
309+ }
310+
311+ function getSafeRolloutParameter ( params : { [ key : string ] : string ; } ) {
312+ const safeRolloutActive = variantService . getFeatureVariables ( 'default' , SAFEROLLOUTACTIVE ) ;
313+ const migrationParam = process . env . REACT_APP_MIGRATION_PARAMETER ;
314+ if ( safeRolloutActive && migrationParam ) {
315+ params . safe_rollout = migrationParam ;
316+ }
317+ }
318+
0 commit comments