Skip to content

Commit

Permalink
Merge pull request #42 from stytchauth/nb/fix-session-issue
Browse files Browse the repository at this point in the history
  • Loading branch information
nicole-stytch authored Apr 10, 2024
2 parents c582c62 + 702cfbf commit 0539e4c
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions lib/sessionService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,6 @@ export function getDiscoverySessionData(
res: ServerResponse
): DiscoverySessionData {
const cookies = new Cookies(req, res);
const sessionJWT = cookies.get("session");
if (sessionJWT) {
return {
sessionJWT,
intermediateSession: undefined,
isDiscovery: false,
error: false,
};
}

const intermediateSession = cookies.get("intermediate_session");
if (intermediateSession) {
Expand All @@ -96,6 +87,16 @@ export function getDiscoverySessionData(
error: false,
};
}

const sessionJWT = cookies.get("session");
if (sessionJWT) {
return {
sessionJWT,
intermediateSession: undefined,
isDiscovery: false,
error: false,
};
}
return { error: true };
}

Expand Down

0 comments on commit 0539e4c

Please sign in to comment.