aws-amplify / aws-amplify/amplify-ui

Authenticator: catching errors from OAuth

Open
#2,172 3 comments 3 reactions 0 assignees View on GitHub
Authenticator feature-request
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:
![image](https://user-images.githubusercontent.com/2905592/174980190-87d460da-2edd-4048-91f7-2d4a1bb3c707.png)

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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.