Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #CO-824: dynamic redirect URL #3972

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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