aws-amplify / aws-amplify/amplify-ui
Authenticator: catching errors from OAuth
- Dominant language
- TypeScript
- Stars
- 1.1k
- Forks
- 347
- Avg merge
- 18h 29m
- Merged PRs (30d)
- 9
Description
### 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:
1. Setup Cognito with federated login using Google
2. Add a "Pre Signup trigger lambda" to Cognito.
3. Throw a error in the lambda.
4. Create a new user through the Authenticator component ``
(Request based on the answer of @ErikCH on [Discord](https://discord.com/channels/705853757799399426/988788878771114004/988887025065263165))
### 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.
Contributor guide
Research direction
Start by reproducing the Vue Authenticator flow with Cognito federated Google login and a failing Pre Sign-up Lambda. Inspect the Authenticator component and the Hub auth events named in the issue; done means the OAuth failure reaches a documented error event so the application can provide user feedback.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, typescript
- Domain
- authentication, frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100