Skip to content

Commit

Permalink
Merge pull request #3972 from shubhambansaltarento/bug/CO-CO-824
Browse files Browse the repository at this point in the history
Issue #CO-824: dynamic redirect URL
  • Loading branch information
santhosh-tg authored Mar 15, 2024
2 parents eb6d21a + cc13e08 commit 6c55e1a
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3159,6 +3159,7 @@ var handleGoogleAuthEvent = () => {
redirectToLib();
}
};

var redirectToPortal = (redirectUrlPath) => { // redirectUrlPath for sso and self signUp
const curUrlObj = window.location;
var redirect_uri = getValueFromSession('redirect_uri');
Expand All @@ -3171,9 +3172,7 @@ var redirectToPortal = (redirectUrlPath) => { // redirectUrlPath for sso and sel
const redirect_uriLocation = new URL(redirect_uri);
if (client_id === 'android' || client_id === 'desktop') {
window.location.href = sessionUrlObj.protocol + '//' + sessionUrlObj.host + redirectUrlPath + updatedQuery;
} else if(client_id === 'portal' &&
redirectUrlPath === '/sign-in/sso/select-org' &&
(redirect_uri.includes('dock.sunbirded.org') || redirect_uri.includes('dockstaging.sunbirded.org'))) {
} else if(client_id === 'portal' && redirectUrlPath === '/sign-in/sso/select-org' && (sessionUrlObj.host !== redirect_uriLocation.host)) {
window.location.href = sessionUrlObj.protocol + '//' + sessionUrlObj.host + redirectUrlPath + updatedQuery;
} else {
window.location.href = redirect_uriLocation.protocol + '//' + redirect_uriLocation.host +
Expand Down

0 comments on commit 6c55e1a

Please sign in to comment.