FEAT: MFA finished + better error handling

This commit is contained in:
Arthur Simas
2022-05-19 12:02:08 -03:00
parent 3e21c308f6
commit 1e239026a3
6 changed files with 251 additions and 118 deletions
+20
View File
@@ -0,0 +1,20 @@
export const Auth = {
UNAUTHORIZED: 'AUTH.UNAUTHORIZED',
FORBIDDEN: 'AUTH.FORBIDDEN',
WRONG_CREDENTIALS: 'AUTH.WRONG_CREDENTIALS',
WRONG_PASSWORD_CONFIRMATION: 'AUTH.WRONG_PASSWORD_CONFIRMATION',
TOTP_NOT_ENABLED: 'AUTH.TOTP_NOT_ENABLED',
TOTP_ALREADY_ENABLED: 'AUTH.TOTP_ALREADY_ENABLED',
TOTP_ALREADY_DISABLED: 'AUTH.TOTP_ALREADY_DISABLED',
TOTP_REQUIRED: 'AUTH.TOTP_REQUIRED',
CODE_MISMATCH: 'AUTH.CODE_MISMATCH',
CODE_ALREADY_USED: 'AUTH.CODE_ALREADY_USED',
};
const ErrorCodes = {
UNKNOWN: 'UNKNOWN',
RATE_LIMIT: 'RATE_LIMIT',
AUTH: Auth,
};
export default ErrorCodes;