Confirm sign up empty code
See original GitHub issueDescribe the bug
When using email and password with amplify the auth.ConfirmSignUp
part doesn’t work as part of the workflow.
To Reproduce Steps to reproduce the behavior:
My logs. email x@googlemail.com authCode_passcodescreen 716541 Authcode before signin 716541 Error when entering confirmation code: Code cannot be empty authCode 716541 email px@googlemail.com authCode_passcodescreen 111111 Authcode before signin 111111 Error when entering confirmation code: Code cannot be empty authCode 111111
Here is the authentication piece of code.
console.log("Authcode before signin", authCode);
await Auth.confirmSignUp({ username: email, authCode: parseInt(authCode) })
.then(data => {
console.log("data", data);
navigation.navigate("SignIn");
console.log("Confirm sign up successful");
})
.catch(err => {
if (!err.message) {
console.log("Error when entering confirmation code: ", err);
console.log("authCode", authCode);
Alert.alert("Error when entering confirmation code: ", err);
} else {
console.log("Error when entering confirmation code: ", err.message);
Alert.alert("Error when entering confirmation code: ", err.message);
}
});
};```
And the pertinent code from the Passcode part of the screen.
``` async confirmSignUp() {
if (
this.state.passCode1 == -1 ||
this.state.passCode2 == -1 ||
this.state.passCode3 == -1 ||
this.state.passCode4 == -1 ||
this.state.passCode5 == -1 ||
this.state.passCode6 == -1
) {
Alert.alert("Please enter 6 digit passcode.");
} else {
//let { state } = this.props.navigation;
// console.error();
//const {username, authCode} = this.state
//const { username } = this.state;
let email = this.state.email;
console.log("email", email);
let authCode =
this.state.passCode1 +
"" +
this.state.passCode2 +
"" +
this.state.passCode3 +
"" +
this.state.passCode4 +
"" +
this.state.passCode5 +
"" +
this.state.passCode6;
//let authCode2 = parseInt(authCode);
console.log("authCode_passcodescreen", authCode);
this.props.confirmSignUp({ username: email }, authCode, this.props.navigation);
}
}
Expected behavior Previously when I was using username, this code worked. I’m confused why the authCode is printed to the logs but isn’t being passed around.
https://github.com/aws-amplify/amplify-js/issues/1924 seems to be a similar issue. Screenshots
Using the IPhone simulator with Iphone 7. On my Mac OSX.
"AppVersion": "ios/12.2",
"Make": "iPhone",
"Model": "iPhone 6/7/8 plus",
"ModelVersion": "12.2",
"Platform": "ios",
}
You can turn on the debug mode to provide more info for us by setting window.LOG_LEVEL = ‘DEBUG’; in your app.
Issue Analytics
- State:
- Created 4 years ago
- Comments:12 (4 by maintainers)
Top GitHub Comments
Not sure if I’m reading this wrong, but I think that Auth.confirmSignup needs to have just the values passed directly in as args, i.e. instead of:
Try
Well the bug seemed to disappear. Maybe a caching issue or something?
On Thu, 1 Aug 2019, 2:58 pm Nader Dabit, notifications@github.com wrote: