diff --git a/ansible/artifacts/sunbird/login/resources/js/telemetry_service.js b/ansible/artifacts/sunbird/login/resources/js/telemetry_service.js index 5b4b6c6125..1460374799 100644 --- a/ansible/artifacts/sunbird/login/resources/js/telemetry_service.js +++ b/ansible/artifacts/sunbird/login/resources/js/telemetry_service.js @@ -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'); @@ -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 +