From 9ca82d7903dcdb7235ae74d98f552803244ab25c Mon Sep 17 00:00:00 2001 From: adrienne-deriv <103016120+adrienne-deriv@users.noreply.github.com> Date: Fri, 17 Jan 2025 11:53:36 +0800 Subject: [PATCH] Adrienne / Set cookies to false to support social login (#17993) * chore: read query params and store them for oidc * chore: remove local storage setter for tokens * chore: set cookies logged_state to false once we are logged in using legacy * chore: remove console log * chore: remove old changes for oidc social logic --- packages/core/src/Stores/client-store.js | 25 +++++++++++------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/packages/core/src/Stores/client-store.js b/packages/core/src/Stores/client-store.js index ca9264019f9c..df54d4655e56 100644 --- a/packages/core/src/Stores/client-store.js +++ b/packages/core/src/Stores/client-store.js @@ -1545,20 +1545,6 @@ export default class ClientStore extends BaseStore { if (search) { if (window.location.pathname !== routes.callback_page) { if (code_param && action_param) this.setVerificationCode(code_param, action_param); - // NOTE: Remove this logic once social signup is intergated with OIDC - const params = new URLSearchParams(window.location.search); - const isUsingLegacyFlow = params.has('token1') && params.has('acct1'); - const loggedState = Cookies.get('logged_state'); - - if (isUsingLegacyFlow && loggedState === 'false') { - const currentDomain = window.location.hostname.split('.').slice(-2).join('.'); - Cookies.set('logged_state', 'true', { - expires: 30, - path: '/', - domain: currentDomain, - secure: true, - }); - } document.addEventListener('DOMContentLoaded', () => { setTimeout(() => { @@ -2256,6 +2242,17 @@ export default class ClientStore extends BaseStore { if (is_account_param) { obj_params[key] = value; is_social_signup_provider = true; + // NOTE: Remove this logic once social signup is intergated with OIDC + const loggedState = Cookies.get('logged_state'); + if (loggedState === 'false') { + const currentDomain = window.location.hostname.split('.').slice(-2).join('.'); + Cookies.set('logged_state', 'true', { + expires: 30, + path: '/', + domain: currentDomain, + secure: true, + }); + } } });