Skip to content

Commit 9ca82d7

Browse files
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
1 parent cf5d152 commit 9ca82d7

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

packages/core/src/Stores/client-store.js

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1545,20 +1545,6 @@ export default class ClientStore extends BaseStore {
15451545
if (search) {
15461546
if (window.location.pathname !== routes.callback_page) {
15471547
if (code_param && action_param) this.setVerificationCode(code_param, action_param);
1548-
// NOTE: Remove this logic once social signup is intergated with OIDC
1549-
const params = new URLSearchParams(window.location.search);
1550-
const isUsingLegacyFlow = params.has('token1') && params.has('acct1');
1551-
const loggedState = Cookies.get('logged_state');
1552-
1553-
if (isUsingLegacyFlow && loggedState === 'false') {
1554-
const currentDomain = window.location.hostname.split('.').slice(-2).join('.');
1555-
Cookies.set('logged_state', 'true', {
1556-
expires: 30,
1557-
path: '/',
1558-
domain: currentDomain,
1559-
secure: true,
1560-
});
1561-
}
15621548

15631549
document.addEventListener('DOMContentLoaded', () => {
15641550
setTimeout(() => {
@@ -2256,6 +2242,17 @@ export default class ClientStore extends BaseStore {
22562242
if (is_account_param) {
22572243
obj_params[key] = value;
22582244
is_social_signup_provider = true;
2245+
// NOTE: Remove this logic once social signup is intergated with OIDC
2246+
const loggedState = Cookies.get('logged_state');
2247+
if (loggedState === 'false') {
2248+
const currentDomain = window.location.hostname.split('.').slice(-2).join('.');
2249+
Cookies.set('logged_state', 'true', {
2250+
expires: 30,
2251+
path: '/',
2252+
domain: currentDomain,
2253+
secure: true,
2254+
});
2255+
}
22592256
}
22602257
});
22612258

0 commit comments

Comments
 (0)