Skip to content

Commit cf5d152

Browse files
Adrienne / Read query params and store them for oidc (#17991)
* chore: read query params and store them for oidc * chore: remove local storage setter for tokens
1 parent f4acd1e commit cf5d152

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1545,6 +1545,21 @@ 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+
}
1562+
15481563
document.addEventListener('DOMContentLoaded', () => {
15491564
setTimeout(() => {
15501565
// timeout is needed to get the token (code) from the URL before we hide it from the URL

packages/hooks/src/useSilentLoginAndLogout.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,6 @@ const useSilentLoginAndLogout = ({
3333
const params = new URLSearchParams(window.location.search);
3434
const isUsingLegacyFlow = params.has('token1') && params.has('acct1');
3535
if (isUsingLegacyFlow && loggedState === 'false' && isOAuth2Enabled) {
36-
const currentDomain = window.location.hostname.split('.').slice(-2).join('.');
37-
Cookies.set('logged_state', 'true', {
38-
expires: 30,
39-
path: '/',
40-
domain: currentDomain,
41-
secure: true,
42-
});
4336
return;
4437
}
4538

0 commit comments

Comments
 (0)