amplify-ui icon indicating copy to clipboard operation
amplify-ui copied to clipboard

Authenticator: catching errors from OAuth

Open denxorz opened this issue 3 years ago • 3 comments

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

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 <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.

denxorz avatar Jun 22 '22 08:06 denxorz

Hi @denxorz !

Thanks for posting this. We'll look into seeing if we can add this.

ErikCH avatar Jun 22 '22 14:06 ErikCH

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")

d-belic avatar Dec 20 '22 09:12 d-belic

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

OperationalFallacy avatar Dec 19 '23 04:12 OperationalFallacy