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(breaking/login): remove 2fa flag in favor of better prompts #619

Merged
merged 3 commits into from
Sep 28, 2022

Conversation

kanadgupta
Copy link
Member

@kanadgupta kanadgupta commented Sep 28, 2022

🚥 Fix RM-5498

🧰 Changes

The --2fa flag that's required to log in with rdme is clunky. Now that we've overhauled our prompts system, it was stupidly easy to add a flow that goes something like this:

  1. User logs in with username and password

  2. API returns a 401 with the LOGIN_TWOFACTOR code, meaning the user forgot to include a 2FA code

  3. rdme checks the error response for the LOGIN_TWOFACTOR code. In that case, it prompts the user for the token and sends another login request with the token!1

By removing the 2fa flag in the rdme client, the login flow is infinitely more smooth. The other great thing is that this requires no changes to our API, so we can maintain backwards compatibility with older versions of rdme.

This PR also includes some minor testbed housekeeping as well.

🧬 QA & Testing

Do these changes make sense to you? And do tests pass?

Footnotes

  1. If the API returns any other error, it just throws it as it normally would.

consolidating some const definitions, removing unnecessary snapshots and configstore handling
@kanadgupta kanadgupta added enhancement New feature or request command:other Issues pertaining to miscellaneous commands (e.g. `open`, `logout`) or requests for new commands labels Sep 28, 2022
@kanadgupta kanadgupta changed the title feat(breaking/login): deprecate 2fa flag in favor of better prompts feat(breaking/login): deprecate 2fa flag in favor of better prompts Sep 28, 2022
@kanadgupta kanadgupta changed the title feat(breaking/login): deprecate 2fa flag in favor of better prompts feat(breaking/login): remove 2fa flag in favor of better prompts Sep 28, 2022
@kanadgupta kanadgupta marked this pull request as ready for review September 28, 2022 20:44
@kanadgupta kanadgupta merged commit 29109ec into main Sep 28, 2022
@kanadgupta kanadgupta deleted the 2fa-improvements branch September 28, 2022 20:44
Copy link
Member

@erunion erunion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bless you for fixing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
command:other Issues pertaining to miscellaneous commands (e.g. `open`, `logout`) or requests for new commands enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants