Closed mgithubmessier closed 2 years ago
I will say that I just ended up solving this by removing the handleSignIn
callback:
handleSignIn: async ({ username, password }) => {
let cognitoUser;
try {
cognitoUser = await Auth.signIn(
username,
password,
)
} catch (error) {
console.error('Failed to sign in with amplify', error);
return;
}
},
And instead making use of the userAuthenticator
hook to pickup on when a user is signed in. It's great when you solve your own problems! Haha
@mgithubmessier awesome! well done 😄
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 amplify-help
forum.
Before opening, please confirm:
JavaScript Framework
React
Amplify APIs
Authentication
Amplify Categories
auth
Environment information
Describe the bug
I've run into a problem using Auth.signIn() with an incorrect username/password where instead of only reporting an invalid username/password error gracefully, there is instead an undefined access error handling the AuthEvent. Seems to me like this could be solved with some optional chaining on the
setUser
function.Expected behavior
After supplying Auth.signIn() with invalid credentials, ONLY the
NotAuthorizedException
should be thrown.Reproduction steps
Auth.signIn
with an invalid username and passwordCode Snippet
Log output
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