Issue Bug Under Review Quiet

#110790Sudo mode dialog shows "bad-request" when the claim has expired

Wolfgang Klinger 09/25/26, 07:44 updated 09/25/26, 07:49

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

  1. Open a backend action that requires sudo mode, for example granting permissions in the access module, or any route with the sudoMode option.
  2. Wait until the password dialog is shown, then leave it open for more than five minutes.
  3. 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 verificationExpired instead of bad-request.
  • The dialog switches to its fatal error state on that answer and replaces the Verify button with Cancel.

Reviews 1

History 12