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:
Adeel Khan
2021-02-19 03:39:06 +05:00
parent e37b8e5cc6
commit 11888fcdc3
6 changed files with 24 additions and 24 deletions

View File

@@ -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;
};

View File

@@ -1,2 +1,2 @@
export { default, getTpaProvider } from './dataUtils';
export { default, getTpaProvider, processTpaHintURL } from './dataUtils';
export { default as AsyncActionType } from './reduxUtils';