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

fix: improve debugging/DX when enabling MFA #822

Merged
merged 3 commits into from
Apr 11, 2024

Conversation

porcellus
Copy link
Collaborator

@porcellus porcellus commented Apr 11, 2024

Summary of change

  • Throw in MFA info endpoint if the user is in a stuck state.
  • Improve error message to indicate possible problem with account linking

Related issues

Test Plan

Existing tests already cover this. (E2E tests needed an update in related auth-react PR)

Documentation changes

N/A

Checklist for important updates

  • Changelog has been updated
  • coreDriverInterfaceSupported.json file has been updated (if needed)
    • Along with the associated array in lib/ts/version.ts
  • frontendDriverInterfaceSupported.json file has been updated (if needed)
  • Changes to the version if needed
    • In package.json
    • In package-lock.json
    • In lib/ts/version.ts
  • Had run npm run build-pretty
  • Had installed and ran the pre-commit hook
  • If new thirdparty provider is added,
    • update switch statement in recipe/thirdparty/providers/configUtils.ts file, createProvider function.
    • add an icon on the user management dashboard.
  • Issue this PR against the latest non released version branch.
    • To know which one it is, run find the latest released tag (git tag) in the format vX.Y.Z, and then find the latest branch (git branch --all) whose X.Y is greater than the latest released tag.
    • If no such branch exists, then create one from the latest released branch.
  • If have added a new web framework, update the add-ts-no-check.js file to include that
  • If added a new recipe / api interface, then make sure that the implementation of it uses NON arrow functions only (like someFunc: function () {..}).
  • If added a new recipe, then make sure to expose it inside the recipe folder present in the root of this repo. We also need to expose its types.

Ellipsis 🚀 This PR description was created by Ellipsis for commit eb6a599.

Summary:

This PR improves the debugging and developer experience when enabling Multi-Factor Authentication (MFA) by enhancing error messages and handling user stuck states due to configuration issues.

Key points:

  • Improved error message in lib/ts/authUtils.ts and lib/build/authUtils.js to indicate potential issues with account linking.
  • Added error throw in lib/ts/recipe/multifactorauth/api/implementation.ts and lib/build/recipe/multifactorauth/api/implementation.js to handle user stuck state due to configuration issues.
  • Updated version to 17.0.4 in lib/build/version.d.ts, lib/build/version.js, lib/ts/version.ts, and package.json.

Generated with ❤️ by ellipsis.dev


Ellipsis 🚀 This PR description was created by Ellipsis for commit bddfae3.

Summary:

This PR improves the debugging and developer experience when enabling Multi-Factor Authentication (MFA) by enhancing error messages, handling user stuck states due to configuration issues, and updating the version to 17.0.4.

Key points:

  • Improved error message in lib/ts/authUtils.ts and lib/build/authUtils.js to indicate potential issues with account linking.
  • Added error throw in lib/ts/recipe/multifactorauth/api/implementation.ts and lib/build/recipe/multifactorauth/api/implementation.js to handle user stuck state due to configuration issues.
  • Updated version to 17.0.4 in lib/build/version.d.ts, lib/build/version.js, lib/ts/version.ts, and package.json.
  • Related issues: Discord convos, auth-react PR
  • Test Plan: Existing tests already cover this. (E2E tests needed an update in related auth-react PR)
  • Documentation changes: N/A
  • Checklist for important updates has been updated

Generated with ❤️ by ellipsis.dev

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me!

  • Reviewed the entire pull request up to eb6a599
  • Looked at 181 lines of code in 9 files
  • Took 1 minute and 21 seconds to review
More info
  • Skipped 1 files when reviewing.
  • Skipped posting 1 additional comments because they didn't meet confidence threshold of 50%.
1. lib/ts/recipe/multifactorauth/api/implementation.ts:110:
  • Assessed confidence : 10%
  • Comment:
    The error message here is clear and provides useful information for debugging. Good job on improving the error handling.
  • Reasoning:
    The changes in the PR seem to be mostly about improving error handling and providing more informative error messages. The code changes in the files 'authUtils.ts', 'implementation.ts', and 'implementation.js' are about adding more detailed error messages and throwing errors in certain situations. The changes in the files 'version.d.ts', 'version.js', and 'version.ts' are about updating the version number of the software. The change in 'package.json' is also about updating the version number. There don't seem to be any logical bugs, performance bugs, or security bugs in the changes. The changes seem to follow best practices.

Workflow ID: wflow_Rw1l7LpWj2poeqRY


Not what you expected? You can customize the content of the reviews using rules. Learn more here.

@rishabhpoddar
Copy link
Contributor

Hey @ellipsis. Please review this

Copy link

ellipsis-dev bot commented Apr 11, 2024

OK! Reviewing this PR...


Responding to this comment by @rishabhpoddar. For more information about Ellipsis, check the documentation.

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me!

  • Performed an incremental review on bddfae3
  • Looked at 83 lines of code in 2 files
  • Took 2 minutes and 9 seconds to review
More info
  • Skipped 0 files when reviewing.
  • Skipped posting 1 additional comments because they didn't meet confidence threshold of 50%.
1. test/mfa/mfa.api.test.js:229:
  • Assessed confidence : 10%
  • Comment:
    The new test case seems to be correctly implemented and checks the expected behavior when the user is in a stuck state due to configuration issues.
  • Reasoning:
    The changes in the test files seem to be correctly implemented. The new test case added in mfa.api.test.js checks if the MFA info endpoint throws an error when the user is in a stuck state due to configuration issues. The changes in utils.js allow the getMfaInfo function to expect different status codes, not just 200, which is necessary for the new test case.

Workflow ID: wflow_ycOE5UAwN8RXiWs7


Not what you expected? You can customize the content of the reviews using rules. Learn more here.

@rishabhpoddar rishabhpoddar merged commit 3f7dd41 into 17.0 Apr 11, 2024
15 of 17 checks passed
@rishabhpoddar rishabhpoddar deleted the fix/debugging_improvements branch April 11, 2024 17:44
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.

2 participants