Frontend: send access token, refresh once on 401 #59
Reference in New Issue
Block a user
Delete Branch "fix/access-token-auth"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Release 2 of 2 for the auth fix (phase 0a in docs/desktop-client.md). Requires #57 to be live on both colors (it is): the pre-#57 backend answers access tokens with 422.
Changes
userService.fetchWithAuthreplaces bothfetchWithRefreshTokenand the oldfetchWithAuth: sends the access token, refreshes up front when none is stored, and on a 401 refreshes once and retries. Concurrent refreshes share one/refreshcall.POST /api/user/refresh;validateTokenstill uses it.oidcService.initiateLoginno longer sends the ignored?redirect=.Deploy / rollback
make redeploy.jwt_access_requiredto access-only and map WrongTokenError to 401 so stale tabs refresh instead of getting a 422.Test plan
yarn build/api/user/refreshaccess_tokenfrom localStorage and reload: still logged in🤖 Generated with Claude Code