Skip to content

Commit f73918d

Browse files
author
Sachin Maheshwari
committed
modify logic to correct the URL
1 parent d9daeeb commit f73918d

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

web-assets/js/setupAuth0WithRedirect.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,20 @@ const authSetup = function () {
367367
const sso_pattern = '/#!/sso-login';
368368
const logout_pattern = '/#!/logout?';
369369

370+
const url = window.location.href;
371+
372+
const result = url.match(/^(.+)(\#!\/(.+)\?)(.+)/);
373+
374+
if (result) {
375+
try {
376+
const newUrl = result[1] + "?" + result[4];
377+
logger("new url: ", newUrl);
378+
window.location.href = newUrl;
379+
} catch (e) {
380+
logger("Creating new url error: ", e.message);
381+
}
382+
}
383+
// Need to cleanup below code, should never execute
370384
if (window.location.href.indexOf(pattern) > -1) {
371385
window.location.href = window.location.href.replace(pattern, '');
372386
}

0 commit comments

Comments
 (0)