Description
The session-transfer UI treats non-2xx responses as successful because neither request checks response.ok or validates the expected response shape.
This is present on develop at f2cf95e06cd613fd0a06bbcb755e044c1dbfe306:
Steps to reproduce
Create flow:
- Visit the transfer UI without an author cookie, so
POST /tokenTransfer returns 400 { "error": "No author cookie to transfer" }.
- Click “Transfer session now”.
The button changes to a checkmark and the copy section is shown. Clicking copy writes undefined because the error body has no id.
Redeem flow:
- Enter a syntactically valid but missing/expired transfer UUID, causing a 404 or 410 JSON response.
- Click the transfer button.
The page reloads as if redemption succeeded.
Expected behavior
The UI should only show success or reload after a 2xx response with the expected body. For an error, it should display the server message (or a localized fallback), restore usable controls, and preserve the page state.
Possible direction
Check response.ok before the success transition, validate id/ok, and handle fetch/JSON failures in both paths.
No plugins are required. I found this while benchmarking an automated code-review workflow and manually verified the current source and duplicate search before reporting it.
Description
The session-transfer UI treats non-2xx responses as successful because neither request checks
response.okor validates the expected response shape.This is present on
developatf2cf95e06cd613fd0a06bbcb755e044c1dbfe306:responseData.idSteps to reproduce
Create flow:
POST /tokenTransferreturns400 { "error": "No author cookie to transfer" }.The button changes to a checkmark and the copy section is shown. Clicking copy writes
undefinedbecause the error body has noid.Redeem flow:
The page reloads as if redemption succeeded.
Expected behavior
The UI should only show success or reload after a 2xx response with the expected body. For an error, it should display the server message (or a localized fallback), restore usable controls, and preserve the page state.
Possible direction
Check
response.okbefore the success transition, validateid/ok, and handle fetch/JSON failures in both paths.No plugins are required. I found this while benchmarking an automated code-review workflow and manually verified the current source and duplicate search before reporting it.