In frontend/src/features/auth.js, the loadUserData function fetches /api/users/ using user.access_token before checking if the user is null or expired.
Problem
If user is null, accessing user.access_token throws a TypeError immediately. If the token is expired, the fetch runs with a stale token
causing a 401 response.
In
frontend/src/features/auth.js, theloadUserDatafunction fetches/api/users/usinguser.access_tokenbefore checking if the user is null or expired.Problem
If
useris null, accessinguser.access_tokenthrows a TypeError immediately. If the token is expired, the fetch runs with a stale tokencausing a 401 response.