List of Cognito authentication error codes and messages
See original GitHub issueIs this related to a new or existing framework?
No response
Is this related to a new or existing API?
Authentication
Is this related to another service?
Cognito
Describe the feature you’d like to request
I would like to be able to find a list of common Cognito authentication error codes and messages so that I could provide a mapping for translation purposes.
Describe the solution you’d like
Either one of the following would be ideal:
- Typescript type for each method’s error codes/messages
- Added to https://github.com/DefinitelyTyped/DefinitelyTyped or this package
OR/AND
- Documentation article which provides this list of error codes/messages
So that I could do something like this:
try {
await Auth.signIn(email, password);
} catch(error) {
const { code, message }: { code: AuthSignInErrorCode | undefined, message: AuthSignInErrorMessage | undefined } = error;
switch(code) {
case AuthSignInErrorCode.USER_NOT_CONFIRMED: {
// do something if user is not confirmed
}
}
}
Describe alternatives you’ve considered
I have considered encountering the errors myself manually and creating my own types, however I’m not aware of each of the errors
Additional context
No response
Is this something that you’d be interested in working on?
- 👋 I may be able to implement this feature request
- ⚠️ This feature might incur a breaking change
Issue Analytics
- State:
- Created 2 years ago
- Reactions:7
- Comments:15 (1 by maintainers)
Top Results From Across the Web
Managing error responses - Amazon Cognito
Amazon Cognito supports customizing error responses returned by user pools. Custom error responses are available for user creation and authentication, ...
Read more >Common Errors - Amazon Cognito User Pools - 亚马逊云科技
This section lists the errors common to the API actions of all Amazon services. For errors specific to an API action for this...
Read more >How to figure which is the right cognito error - Stack Overflow
How do you authenticate a user in a user pool via Cognito when error messages say userName and password don't match even though...
Read more >Okta API Error Codes - Okta Developer
Okta error codes and descriptions. This document contains a complete list of all errors that the Okta API returns. All errors contain the...
Read more >OAuth HTTP error response reference | Apigee Edge
On this page · Authorization Code. Invalid Redirect URI; No Redirect URI · Generate AccessToken. Invalid Auth Code · Implicit. Invalid Client ID...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I ended up with a hook returning keyed object like that, here’s an example:
This way I am able to translate the errors easily and control what will be displayed to the user + side effects
@joelzwarrington woops, I skimmed this thread in a rush (it’s been a long day), apologies.
That did the trick for now, thank you very much. 😄