"Unknown error, the response body from fetch is: undefined" at Auth.confirmSignIn
See original GitHub issueDescribe the bug
I am trying to send the verification code received by the user to confirm the signIn, I have the SMS_MFA enabled. However, I keep getting this error Unknown error, the response body from fetch is: undefined
and thats all I get, there is nothing else to help me understand what the error is about. And everything else is working fine, I call signIn, signUp, confirmSignUp and resendSignUp, they all work fine. The problem is only with confirmSignIn and I have no idea what it could be, I already researched online, but had no success. Another strange thing that happens, when I enter the wrong code, it shows me the ‘CodeMismatchException’, but it fails with ‘Unknown error’ when code is the right one. PS: I already have cognito configured to work with SMS MFA
To Reproduce Steps to reproduce the behavior: I just installed aws-amplify and started using Auth according to the docs, everything else works fine, it’s just when I call confirmSignIn
Expected behavior Receive a successful response when the correct code is sent for verification.
Smartphone (please complete the following information): The problem happens in android and iOS
Additional context I’m using: react-native version 0.55.4 aws-amplify version ^1.0.11
Code I have a file where a call all the Auth functions and export them
export const confirmSignIn = (cognitoUser, code) => Auth.confirmSignIn(cognitoUser, code, 'SMS_MFA');
Then I call that confirmSignIn function from a different file
confirmSignIn(cognitoUser, code).then((userSession) => {
console.log(userSession);
}).catch((error) => {
switch (error.name) {
case 'CodeMismatchException':
this.codeInput.clear();
break;
default:
console.log(error);
break;
}
});
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (2 by maintainers)
Top GitHub Comments
@jordanranz not anymore. After I posted the issue I didn’t use the confirmSignIn for a while and forgot about the issue and then I had to use it again and it’s working fine now. I’m using the same react-native version, 0.55.4, react 16.3.1 but updated the aws-amplify to ^1.1.19, probably that was it.
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.