fix(ui): sudo confirmation before team delete#289
Closed
kkopanidis wants to merge 2 commits into
Closed
Conversation
Prompt for admin re-authentication when the session JWT lacks sudo before calling DELETE /authentication/teams/:teamId, matching the new API guard.
Sudo applies to Client API end-user actions, not Admin API routes. Conduit-UI team delete uses the admin API and does not need re-auth.
Contributor
Author
|
Closing: sudo is for Client API end-user actions (user bearer token), not Admin API. Team delete in Conduit-UI uses |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Team delete in the admin UI called
DELETE /authentication/teams/:teamIdwithout checking whether the admin session had sudo. After the API change, deletes would fail for sessions missing the sudo claim unless the UI re-authenticates first.Solution
hasSudoAccess,sudoReauthenticate, andcompleteSudoTwoFactorserver actionsSudoDialog+useSudoActionhook to collect password (and 2FA when required) before sensitive operationsrunWithSudoso re-auth runs only when the JWT lacks sudotokenand legacyresultresponse shapesTest plan
sudoclaim) — password dialog appears, then delete succeeds