diff --git a/src/javascript/app/base/page.js b/src/javascript/app/base/page.js index b3fa2b84caa..936f207da84 100644 --- a/src/javascript/app/base/page.js +++ b/src/javascript/app/base/page.js @@ -59,8 +59,6 @@ const Page = (() => { case 'active_loginid': // reload the page when the client changes account on other pages. if (evt.newValue === '' || !window.is_logging_in) { - // eslint-disable-next-line - console.log('we are reloading wtf, window.is_logging_in: ', window.is_logging_in, evt) reload(); } break; @@ -103,7 +101,7 @@ const Page = (() => { updateLinksURL('#content'); } else { init(); - // requestSingleSignOn(); + requestSingleSignOn(); if (!isLoginPages()) { Language.setCookie(Language.urlLang()); const url_query_strings = Url.paramsHash(); diff --git a/src/javascript/app/pages/callback/callback.jsx b/src/javascript/app/pages/callback/callback.jsx index 5788c0d8cb6..bdd7ed1559f 100644 --- a/src/javascript/app/pages/callback/callback.jsx +++ b/src/javascript/app/pages/callback/callback.jsx @@ -73,17 +73,13 @@ const CallbackContainer = () => { isStorageSupported(sessionStorage) && account_list ) { - // eslint-disable-next-line - console.log('we have called authorize', account_list, tokens); // redirect url redirect_url = sessionStorage.getItem('redirect_url'); sessionStorage.removeItem('redirect_url'); storeClientAccounts(tokens, account_list); } else { - // eslint-disable-next-line - console.log('apparently we are logging out', response, account_list) - // Client.doLogout({ logout: 1 }); + Client.doLogout({ logout: 1 }); } // redirect back @@ -117,13 +113,15 @@ const CallbackContainer = () => { } getElementById('loading_link').setAttribute('href', redirect_url); - // eslint-disable-next-line - console.log('setting cookie....SHOULD BE TRUEEEE') - Cookies.set('logged_state', 'true', { - expires: 30, - path : '/', - secure : true, - }); + const domains = ['deriv.com', 'binary.sx', 'pages.dev', 'localhost']; + const currentDomain = window.location.hostname.split('.').slice(-2).join('.'); + if (domains.includes(currentDomain)) { + Cookies.set('logged_state', 'true', { + expires: 30, + path : '/', + secure : true, + }); + } window.location.href = redirect_url; // need to redirect not using pjax });