Skip to content

Commit 1effb6d

Browse files
author
sachin-maheshwari
authored
Merge pull request #64 from topcoder-platform/dev
delete extra cookies and adding alert if no return url
2 parents 213c9c8 + 2278679 commit 1effb6d

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

web-assets/js/setupAuth0WithRedirect.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ const authSetup = function () {
6161

6262
const init = function () {
6363
correctOldUrl();
64+
changeWindowMessage();
6465
createAuth0Client({
6566
domain: domain,
6667
client_id: clientId,
@@ -161,6 +162,13 @@ const authSetup = function () {
161162
setCookie(tcJWTCookie, "", -1);
162163
setCookie(v3JWTCookie, "", -1);
163164
setCookie(tcSSOCookie, "", -1);
165+
166+
// to clear any old session
167+
setCookie('auth0Jwt', "", -1);
168+
setCookie('zendeskJwt', "", -1);
169+
setCookie('auth0Refresh', "", -1);
170+
// for scorecard
171+
setCookie('JSESSIONID', "", -1);
164172
};
165173

166174
const isLoggedIn = function () {
@@ -355,6 +363,17 @@ const authSetup = function () {
355363

356364
}
357365

366+
function changeWindowMessage() {
367+
if ((!returnAppUrl && !appUrl) || ((returnAppUrl == 'undefined') && (appUrl == 'undefined'))) {
368+
try {
369+
document.getElementById("page-title-heading").innerHTML = "Alert";
370+
document.getElementById("loading_message_p").innerHTML = "Login/Logout action is not called. Please check return url (retUrl) value in query parameters."
371+
} catch (err) {
372+
logger("Error in changing loading message: ", err.message)
373+
}
374+
}
375+
}
376+
358377
// execute
359378
init();
360379
};

web-assets/static-pages/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
<main id="main" class="page-main">
3636
<a id="contentarea" tabindex="-1"></a>
3737
<h1 id="page-title-heading" class="page-title-heading">loading...</h1>
38-
<p class="page-description">
38+
<p class="page-description" id="loading_message_p">
3939
Wait Login/Logout processing ...
4040
</p>
4141
</main>

0 commit comments

Comments
 (0)