Skip to content

Commit 2b174ec

Browse files
author
Sachin Maheshwari
committed
adding logout link on home screen
1 parent 904707d commit 2b174ec

File tree

1 file changed

+19
-13
lines changed

1 file changed

+19
-13
lines changed

web-assets/js/setupAuth0WithRedirect.js

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -200,18 +200,18 @@ const authSetup = function () {
200200
});
201201
};
202202

203-
const clearAllCookies = function() {
204-
// TODO
205-
setCookie(tcJWTCookie, "", -1);
206-
setCookie(v3JWTCookie, "", -1);
207-
setCookie(tcSSOCookie, "", -1);
208-
209-
// to clear any old session
210-
setCookie('auth0Jwt', "", -1);
211-
setCookie('zendeskJwt', "", -1);
212-
setCookie('auth0Refresh', "", -1);
213-
// for scorecard
214-
setCookie('JSESSIONID', "", -1);
203+
const clearAllCookies = function () {
204+
// TODO
205+
setCookie(tcJWTCookie, "", -1);
206+
setCookie(v3JWTCookie, "", -1);
207+
setCookie(tcSSOCookie, "", -1);
208+
209+
// to clear any old session
210+
setCookie('auth0Jwt', "", -1);
211+
setCookie('zendeskJwt', "", -1);
212+
setCookie('auth0Refresh', "", -1);
213+
// for scorecard
214+
setCookie('JSESSIONID', "", -1);
215215
}
216216

217217
const isLoggedIn = function () {
@@ -421,10 +421,16 @@ const authSetup = function () {
421421
}
422422

423423
function changeWindowMessage() {
424+
424425
if ((!returnAppUrl && !appUrl) || ((returnAppUrl == 'undefined') && (appUrl == 'undefined'))) {
425426
try {
427+
var hdomain = location.hostname.split('.').reverse()[1];
428+
var linkurl = "http://" + window.location.host + "/?logout=true&retUrl=http://" + window.location.host;
429+
if (hdomain) {
430+
linkurl = "https://" + window.location.host + "/?logout=true&retUrl=https://" + hdomain + ".com";
431+
}
426432
document.getElementById("page-title-heading").innerHTML = "Alert";
427-
document.getElementById("loading_message_p").innerHTML = "Login/Logout action is not called. Please check return url (retUrl) value in query parameters."
433+
document.getElementById("loading_message_p").innerHTML = "Login/Logout action is not called. Please check return url (retUrl) value in query parameters or <a href=" + linkurl + ">click here</a>";
428434
} catch (err) {
429435
logger("Error in changing loading message: ", err.message)
430436
}

0 commit comments

Comments
 (0)