Fix to let tpa_hint url have ? instead of &
Now the url could also be of the form ?next=/dashboard?tpa_hint=oa2-google-oauth2 to be backward compatible with old url. VAN-42
This commit is contained in:
@@ -25,3 +25,18 @@ export const getTpaProvider = (tpaHintProvider, primaryProviders, secondaryProvi
|
||||
}
|
||||
return tpaProvider;
|
||||
};
|
||||
|
||||
export const processTpaHintURL = (params) => {
|
||||
let tpaHint = null;
|
||||
tpaHint = params.get('tpa_hint');
|
||||
if (!tpaHint) {
|
||||
const next = params.get('next');
|
||||
if (next) {
|
||||
const index = next.indexOf('tpa_hint=');
|
||||
if (index !== -1) {
|
||||
tpaHint = next.substring(index + 'tpa_hint='.length, next.length);
|
||||
}
|
||||
}
|
||||
}
|
||||
return tpaHint;
|
||||
};
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
export { default, getTpaProvider } from './dataUtils';
|
||||
export { default, getTpaProvider, processTpaHintURL } from './dataUtils';
|
||||
export { default as AsyncActionType } from './reduxUtils';
|
||||
|
||||
Reference in New Issue
Block a user