feat: Add browser confirm for CLI token rotation #337
Merged
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.
Description
This commit adds a browser native confirm dialog to the CLI token rotation process. When the user clicks the "Regenerate CLI token" button, they are presented with a confirmation dialog that warns them that all previous CLI access will be revoked. The user must confirm this action before the token is rotated. This ensures that the user is aware of the consequences of rotating their token and prevents accidental token rotation.
The code has been modified to set the new token only after the user confirms the action. This ensures that the "Regenerate CLI token" button remains visible until the user confirms.
Closes #328
Type of change
How Has This Been Tested?
To manually test the new feature, I did the following:
I also tested the edge case where I canceled the confirmation dialog, and saw that the token was not updated.
Checklist: