During AWS Cogito User Pool there are two options for how to let users sign in. One of them is
Username - Users can use a username and optionally multiple alternatives to sign up and sign in.
Also allow sign in with verified email address
I have selected the above and while testing it using aws-amplify I always get __type: "NotAuthorizedException"
message: "Incorrect username or password." if I try to sign in with email but it works fine when I try to sign in with the username.
Here is my signin method
Auth.signIn(email, password)
.then(r => {
setLoggedIn(true);
})
.catch(r => {
setLoggedIn(false);
})
};