A signed-in session left open on an unlocked laptop is a valid session. Sudo mode makes it insufficient for the actions that matter.
| Key | Default |
|---|---|
sudo.enabled | true |
sudo.ttl | 15 minutes |
sudo.areas | empty |
How it works
The gate is applied centrally, on rest_pre_dispatch, rather than in each controller. A write to a sensitive route without a fresh confirmation returns 403 itxuo_sudo_required, and the admin app catches that, prompts for re-authentication, and retries the original request.
That is a deliberate architectural choice: a per-controller check is one someone forgets to add to the next controller. A central gate covers routes that do not exist yet.
What counts as sensitive
Writes matching the sensitive-route list — changing roles, disabling accounts, resetting somebody's second factor, revoking passkeys, editing security settings, containment.
Reading is never gated. Sudo mode does not make the console harder to use; it makes it harder to *change things* from a session that has been sitting idle.
Confirming
Your current password, or a two-factor code, or a recovery code. Any of the three.
Accepting a 2FA code matters for single sign-on users, who may not have a local password to type.
The window
sudo.ttl is how long a confirmation lasts, in minutes. The default is 15.
Longer is less friction and a wider window for a stolen session. Fifteen minutes is enough to work through a batch of related changes without re-confirming for each one.
Clearing a stuck state
wp itxuo sudo-clear <user>
Clears one account's sudo state. Useful if a confirmation is somehow wedged and the prompt loops.
The kill switch
define( 'ITXUO_DISABLE_SUDO', true );
Note on the default
Sudo is one of the few premium features that defaults to on, because the failure mode is a prompt rather than a lockout. If you cannot pass it, you can still read everything and you still have the CLI.