Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add browser confirm for CLI token rotation #337

Merged
merged 1 commit into from
Apr 6, 2023

Conversation

ttebify
Copy link
Collaborator

@ttebify ttebify commented Apr 6, 2023

Description

Please include a summary of the changes and the related issue. Please also include relevant motivation and context. List any dependencies that are required for this change.

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

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

To manually test the new feature, I did the following:

  1. Logged in to my account and opened a project page.
  2. Clicked the "Regenerate CLI token" button and saw the confirmation dialog.
  3. Confirmed the action and saw that the token was updated.

I also tested the edge case where I canceled the confirmation dialog, and saw that the token was not updated.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I documented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@ttebify ttebify requested a review from dahal April 6, 2023 03:22
@dahal dahal merged commit 9841e18 into main Apr 6, 2023
6 checks passed
@dahal dahal deleted the feat/browser-confirm-token-rotation branch April 6, 2023 03:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE]: trigger browser native confirm before allowing CLI token rotation
3 participants