amplify-ui
amplify-ui copied to clipboard
Authenticator: catching errors from OAuth
On which framework/platform would you like to see this feature implemented?
Vue
Which UI component is this feature-request for?
Authenticator
Please describe your feature-request in detail.
Our Cognito (with OAuth) sometimes throws errors. And I am unable to handle them.
Example of an error:

How to reprocude:
- Setup Cognito with federated login using Google
- Add a "Pre Signup trigger lambda" to Cognito.
- Throw a error in the lambda.
- Create a new user through the Authenticator component
<authenticator :social-providers="['google']" />
(Request based on the answer of @ErikCH on Discord)
Please describe a solution you'd like.
We would like to handle the erros and give feedback to the user. It would be nice if the Authenticator gives an event in case of errors, or that the Hub gives an event.
For example; @onError="(data)=>console.log('Sign in failure', data)" .
or
Hub.listen('auth', (data) => {
case 'signIn_failure':
case 'cognitoHostedUI_failure':
console.log('Sign in failure', data);
break;
});
We love contributors! Is this something you'd be interested in working on?
- [ ] 👋 I may be able to implement this feature request.
- [ ] ⚠️ This feature might incur a breaking change.
Hi @denxorz !
Thanks for posting this. We'll look into seeing if we can add this.
Any progress on this one? Still not possible to catch errors in this case at least for me (using "@aws-amplify/ui-react": "^3.2.1")
Interested as well in this.
The Hub.listen('auth') can get signInWithRedirect_failure, should this be the error handling for signups with redirect? I'm not sure what to do with it, given that the original page with signup form gets redirected to site/error_description=PreSignUp+failed.... page