From 843b1ebdcd465ae77334883d3048dee811bde84e Mon Sep 17 00:00:00 2001 From: Sachin Maheshwari Date: Tue, 20 Oct 2020 15:08:16 +0530 Subject: [PATCH 1/3] clearing old session cookies too --- web-assets/js/setupAuth0WithRedirect.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/web-assets/js/setupAuth0WithRedirect.js b/web-assets/js/setupAuth0WithRedirect.js index 128d86a..8c769c2 100644 --- a/web-assets/js/setupAuth0WithRedirect.js +++ b/web-assets/js/setupAuth0WithRedirect.js @@ -161,6 +161,11 @@ const authSetup = function () { setCookie(tcJWTCookie, "", -1); setCookie(v3JWTCookie, "", -1); setCookie(tcSSOCookie, "", -1); + + // to clear any old session + setCookie('auth0Jwt', "", -1); + setCookie('zendeskJwt', "", -1); + setCookie('auth0Refresh', "", -1); }; const isLoggedIn = function () { From 5d8d4a6428a6809dc8976468bd98947fc4e2ae55 Mon Sep 17 00:00:00 2001 From: Sachin Maheshwari Date: Tue, 20 Oct 2020 16:53:59 +0530 Subject: [PATCH 2/3] loading message change if login/logout action is called. --- web-assets/js/setupAuth0WithRedirect.js | 12 ++++++++++++ web-assets/static-pages/index.html | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/web-assets/js/setupAuth0WithRedirect.js b/web-assets/js/setupAuth0WithRedirect.js index 8c769c2..bc2a113 100644 --- a/web-assets/js/setupAuth0WithRedirect.js +++ b/web-assets/js/setupAuth0WithRedirect.js @@ -61,6 +61,7 @@ const authSetup = function () { const init = function () { correctOldUrl(); + changeWindowMessage(); createAuth0Client({ domain: domain, client_id: clientId, @@ -360,6 +361,17 @@ const authSetup = function () { } + function changeWindowMessage() { + if (!returnAppUrl || returnAppUrl == 'undefined') { + try { + document.getElementById("page-title-heading").innerHTML = "Alert"; + document.getElementById("loading_message_p").innerHTML = "Login/Logout action is not called. Please check return url (retUrl) value in query parameters." + } catch (err) { + logger("Error in changing loading message: ", err.message) + } + } + } + // execute init(); }; diff --git a/web-assets/static-pages/index.html b/web-assets/static-pages/index.html index b572ca9..38db79e 100644 --- a/web-assets/static-pages/index.html +++ b/web-assets/static-pages/index.html @@ -35,7 +35,7 @@

loading...

-

+

Wait Login/Logout processing ...

From 2278679d527b9a217ccd5a5cb791f0e1f9d16366 Mon Sep 17 00:00:00 2001 From: Sachin Maheshwari Date: Tue, 20 Oct 2020 19:21:21 +0530 Subject: [PATCH 3/3] deleteing JSESSIONID cookie on logout --- web-assets/js/setupAuth0WithRedirect.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/web-assets/js/setupAuth0WithRedirect.js b/web-assets/js/setupAuth0WithRedirect.js index bc2a113..0b0f71f 100644 --- a/web-assets/js/setupAuth0WithRedirect.js +++ b/web-assets/js/setupAuth0WithRedirect.js @@ -167,6 +167,8 @@ const authSetup = function () { setCookie('auth0Jwt', "", -1); setCookie('zendeskJwt', "", -1); setCookie('auth0Refresh', "", -1); + // for scorecard + setCookie('JSESSIONID', "", -1); }; const isLoggedIn = function () { @@ -362,7 +364,7 @@ const authSetup = function () { } function changeWindowMessage() { - if (!returnAppUrl || returnAppUrl == 'undefined') { + if ((!returnAppUrl && !appUrl) || ((returnAppUrl == 'undefined') && (appUrl == 'undefined'))) { try { document.getElementById("page-title-heading").innerHTML = "Alert"; document.getElementById("loading_message_p").innerHTML = "Login/Logout action is not called. Please check return url (retUrl) value in query parameters."