Skip to content

Commit 6bea65a

Browse files
committed
Fix session revalidation corner case
When Session.currentUser was missing from localStorage and there was a sessionid cookie, the currentUser wouldn't be fetched, because sessionValid returned true.
1 parent 931ae86 commit 6bea65a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

packages/ts-api-react/src/SessionContext.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ export const sessionValid = (
142142
// sessionid present but no currentUser, session is stale
143143
if (storedCurrentUser === null) {
144144
_storage.setValue(STALE_KEY, "yes");
145+
return false;
145146
}
146147
return true;
147148
}

0 commit comments

Comments
 (0)