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

Setting up token mfa fails without phone number #846

Closed
CrispySnow opened this issue May 17, 2018 · 1 comment
Closed

Setting up token mfa fails without phone number #846

CrispySnow opened this issue May 17, 2018 · 1 comment
Labels
bug Something isn't working

Comments

@CrispySnow
Copy link

Do you want to request a feature or report a bug?
Bug
What is the current behavior?
when calling Auth.setPreferredMFA(user, 'TOTP'); an error is reported that the user does not have a phone number setup.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than AWS Amplify.
Signup a user with a username and email
Setup TOTP and verify token
Then call Auth.setPreferredMFA(user, 'TOTP');

What is the expected behavior?
No error is returned

Which versions of Amplify, and which browser / OS are affected by this issue? Did this work in previous versions?
0.4

You can turn on the debug mode to provide more info for us by setting window.LOG_LEVEL = 'DEBUG'; in your app.

The error comes from line 394 in Auth.ts:
user.setUserMfaPreference(smsMfaSettings, totpMfaSettings, (err, result) =>

if smsMfaSettings is set to null instead of {PreferredMfa : false,Enabled : false} the server reacts as expected. This is probably a bug on the server side, not respecting the Enabled: false, but the only way to get the expected result is to pass null here.

@github-actions
Copy link

This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels or Discussions for those types of questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants