colossal-appointment-48082
07/12/2023, 11:52 PMsalmon-night-88354
07/13/2023, 12:00 AMcolossal-appointment-48082
07/13/2023, 12:00 AMclear cache for the users
ancient-motorcycle-2291
07/13/2023, 4:53 AMgreat-diamond-35515
07/13/2023, 6:42 AMcolossal-appointment-48082
07/13/2023, 4:18 PMconst useDoptSession = () => {
const session = useSession();
if (session.isAuthenticated && session.sessionToken !== tokenRef.current) {
if (!storedRefreshToken()) {
signInOrUp();
} else me();
}
tokenRef.current = session.sessionToken;
return session;
};
then to use it in a guard component
export const Guard = ({ children }: PropsWithChildren) => {
const location = useLocation();
const { useDoptSession, useUser, validSessionToken } = useAuth();
const { isSessionLoading, isAuthenticated } = useDoptSession();
...
its worth noting that we don't see this loop for every user. but we do see it consistently for some users, and I haven't been able to reproduce on my machinecolossal-appointment-48082
07/14/2023, 11:08 PMgreat-diamond-35515
07/15/2023, 9:07 AMcolossal-appointment-48082
07/17/2023, 3:28 PM