Skip to content

Commit

Permalink
stateData needs to be in localStorage for confirmation links
Browse files Browse the repository at this point in the history
  • Loading branch information
garronej committed Feb 8, 2025
1 parent 6f55c56 commit a909516
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/oidc/StateData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export function getStateData(params: {

const KEY = `${STATE_STORE_KEY_PREFIX}${configHash}`;

const lsItem = sessionStorage.getItem(KEY);
const lsItem = localStorage.getItem(KEY);

if (lsItem === null) {
return undefined;
Expand All @@ -71,7 +71,7 @@ export function getStateData(params: {

data.hasBeenProcessedByCallback = true;

sessionStorage.setItem(KEY, JSON.stringify(obj));
localStorage.setItem(KEY, JSON.stringify(obj));
}

return data;
Expand Down
2 changes: 1 addition & 1 deletion src/oidc/createOidc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ export async function createOidc_nonMemoized<
scope: Array.from(new Set(["openid", ...scopes])).join(" "),
automaticSilentRenew: false,
userStore: new WebStorageStateStore({ store: new InMemoryWebStorage() }),
stateStore: new WebStorageStateStore({ store: sessionStorage, prefix: STATE_STORE_KEY_PREFIX }),
stateStore: new WebStorageStateStore({ store: localStorage, prefix: STATE_STORE_KEY_PREFIX }),
client_secret: __clientSecret_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
});

Expand Down

0 comments on commit a909516

Please sign in to comment.