#110790Sudo mode dialog shows "bad-request" when the claim has expired
Description
Problem
When the sudo mode password dialog stays open for more than five minutes and the password is submitted afterwards, the dialog shows the raw string “bad-request” in a red box. The password field and the Verify button stay active, but every further submit shows the same string.
Steps to reproduce
- Open a backend action that requires sudo mode, for example granting permissions in the access module, or any route with the
sudoModeoption. - Wait until the password dialog is shown, then leave it open for more than five minutes.
- Enter the user password and click Verify.
Observed behaviour
A red box with the text “bad-request” appears above the password field. The form stays usable, but every retry ends with the same text. There is no hint that the confirmation is gone and that the action has to be started again.
Expected behaviour
The dialog tells the user that the confirmation has expired, hides the password field, and offers only a Cancel button. Closing the dialog lets the user start the action again.
Cause
A claim lives for 300 seconds (AccessFactory::DEFAULT_CLAIM_LIFETIME). After that, SudoModeController::verifyAction() cannot resolve the claim and answers with the JSON message bad-request and status 400. The dialog in sudo-mode.ts looks up messages as label keys and prints unknown keys as they are. The label verificationExpired (“Confirmation has expired. Please try again.”) and the fatal error state of the dialog already exist, but only the server rendered error route uses them. The AJAX path never reaches them.
Fix
- The verify endpoint answers with
verificationExpiredinstead ofbad-request. - The dialog switches to its fatal error state on that answer and replaces the Verify button with Cancel.
Reviews 1
History 12
-
Gerrit Code Review pushed patch set 1 for main to change 96064 status
NewUnder Review <span data-processor="relativetime" data-value="2026-09-25T07:46:43+00:00" > 09/25/26, 07:46 </span> -
Wolfgang Klinger changed assigned to Wolfgang Klinger <span data-processor="relativetime" data-value="2026-09-25T07:49:18+00:00" > 09/25/26, 07:49 </span>