I am making an app and I am using Cognito for auth. However, When I register, the account shows up in cognito but I receive a verification code and I have to manually confirm the account. I have a screen where I let the user add the code that they received to activate their account. Can anybody help me on what call do I send to Cognito in order to activate my account without having to manually confirm?
const signup = (event) => {
event.preventDefault();
if (formValidation()) {
UserPool.signUp(username, password, [], [], (err, data) => {
if (err) console.error(err);
console.log(data);
});
}
};
This is the function I am using to sign up users. How do I confirm the user?
You can use admin confirm sign up to confirm user without entering the verification code. As this is an admin method, the call will need to be authenticated with AWS credentials that have the right to perform this action.
Link to documentation: https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/CognitoIdentityServiceProvider.html#adminConfirmSignUp-property