Description
Before opening, please confirm:
- I have searched for duplicate or closed issues and discussions.
- I have read the guide for submitting bug reports.
- I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
JavaScript Framework
React
Amplify APIs
Authentication
Amplify Version
v6
Amplify Categories
auth
Backend
None
Environment information
# Put output below this line
Describe the bug
We are trying to implement MFA (Multi-Factor Authentication) using email-based authentication. We have followed the steps and configured the SDK as per the official documentation:
https://docs.amplify.aws/javascript/start/connect-to-aws-resources/
However, we are still encountering the following error:
signInHelpers.ts:611 Uncaught (in promise) SignInException: An error occurred during the sign in process. EMAIL_OTP challengeName returned by the underlying service was not addressed. at getSignInResult (http://localhost:3000/static/js/bundle.js:85307:9) at signInWithSRP (http://localhost:3000/static/js/bundle.js:82737:85) at async loginBtnClick (http://localhost:3000/main.a99b129….hot-update.js:67:9)
We have reviewed the guide but could only find information related to SMS or TOTP-based MFA:
https://docs.amplify.aws/react/build-a-backend/auth/concepts/multi-factor-authentication/#enable-totp-after-a-user-is-signed-in
We also tried implementing the functionality using amplify/ui-react, but the error persists.
We are using the SDK version :
aws-amplify : v6.6.5
Is there a way to achieve email-based MFA with the above setup? Any guidance or solutions would be greatly appreciated.
Expected behavior
Complete the sign-in process without errors after the correct OTP is entered.
Reproduction steps
- First, install the SDK and configure it with Cognito.
- After that, call the
signIn
method from the SDK and pass the email and password.
Code Snippet
Amplify.configure({
Auth: {
Cognito: {
userPoolId: get(authcredetilas, "userPoolId", null),
region: get(authcredetilas, "region", null),
userPoolClientId: get(
authcredetilas,
"userPoolWebClientId",
null
),
identityPoolId: get(authcredetilas, "identityPoolId", null),
loginWith: {
email: true,
},
},
},
});
And
await signIn({
username: "****",
password: "****",
})
Log output
// Put your logs below this line
aws-exports.js
No response
Manual configuration
No response
Additional configuration
No response
Mobile Device
No response
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response