You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Invalid stored token expiry is treated as a valid session #186
The token expiry check treats an invalid date as "not expired". dayjs().isAfter(dayjs('garbage')) is false, so a stored expiry that isn't a valid date counts as a valid session. This applies to checkToken in AuthProvider (auth.tsx#L126) and to the request interceptor (auth.tsx#L62).
An invalid value can be stored: the response interceptor builds the expiry with dayjs.unix(Number.parseInt(expiryHeader, 10)) (auth.tsx#L87), and an expiry header that isn't numeric gives NaN and an invalid date.
Impact
The session never expires on the client. isAuthenticated stays true, and the request interceptor never clears the tokens. With #183, hasValidSession() reuses the same check to route deep links, so those would open protected screens directly too.
Activity