fix(web): show forbidden/unauthenticated download errors distinctly (BUNYIP-49) #58
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/bunyip-49-downloads-forbidden-message"
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?
Problem
The downloads page (
bunyip-webdashboard.rs::downloads) rendered everydownloads_allerror as a single generic message: "Downloads are temporarily unavailable. Refresh the page to try again." ButGET /v1/downloads(bunyip-apiMemberUserextractor) returns 403 when the caller lacks member access and 401 when the session is rejected. In staging the page showed "temporarily unavailable" while the API was actually returning 401 (GET /v1/users/me -> 401 Unauthorized), so an auth/permissions failure masqueraded as a transient outage and told the user to refresh - which can never fix it.Fix
ApiErroralready carries the HTTPstatus, so branch on it indownloads:upgrade_link()(->/membership).Okrendering is unchanged. Backend is unchanged - it already returns the correct 401/403; only the frontend's interpretation was wrong.Note (separate, not fixed here)
The staging 401 means bunyip-web's page guard accepts the BFF session but the forwarded credential is rejected by bunyip-api - a likely token-forwarding/config issue worth its own investigation. This PR only corrects the user-facing message.
Verification
just check-containergreen: fmt + clippy -D warnings + tests (bunyip-web 7 passed).#BUNYIP-49