Skip to content

Commit

Permalink
Adrienne / Fix reset password getting SSOed (#18018) (#18027)
Browse files Browse the repository at this point in the history
* chore: only set logged state cookies when we see acct and token in params

---------

Co-authored-by: adrienne-deriv <[email protected]>
  • Loading branch information
prince-deriv and adrienne-deriv authored Jan 24, 2025
1 parent 7eb980d commit 23c89aa
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/core/src/Stores/client-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -2238,13 +2238,19 @@ export default class ClientStore extends BaseStore {
const is_account_param = account_keys.some(
account_key => key?.includes(account_key) && key !== 'affiliate_token'
);
const auth_keys = ['acct', 'token'];
const is_acct_token_params = auth_keys.some(
account_key => key?.includes(account_key) && key !== 'affiliate_token'
);

if (is_account_param) {
obj_params[key] = value;
is_social_signup_provider = true;
// NOTE: Remove this logic once social signup is intergated with OIDC
// NOTE: We only set logged_state to true when the params has acct1, token1 params
const loggedState = Cookies.get('logged_state');
if (loggedState === 'false') {

if (loggedState === 'false' && is_acct_token_params && !search_params.get('action') === 'signup') {
const currentDomain = window.location.hostname.split('.').slice(-2).join('.');
Cookies.set('logged_state', 'true', {
expires: 30,
Expand Down

0 comments on commit 23c89aa

Please sign in to comment.