Better error handling and documentation on refresh token

This commit is contained in:
Gabriel Rosa
2023-02-14 09:25:14 -03:00
parent de06512249
commit c5c089e5d5
6 changed files with 63 additions and 29 deletions
+8
View File
@@ -119,6 +119,14 @@ export function EnrichErrorCode(code: string) {
code,
};
case ErrorCodes.AUTH.INVALID_REFRESH_TOKEN:
return {
statusCode: HttpStatus.UNAUTHORIZED,
error: 'Acesso expirado!',
message: 'Seu acesso expirou, favor fazer login novamente.',
code,
};
case ErrorCodes.AUTH.FORBIDDEN:
return {
statusCode: HttpStatus.FORBIDDEN,
+1
View File
@@ -1,5 +1,6 @@
export const AUTH = {
UNAUTHORIZED: 'AUTH.UNAUTHORIZED',
INVALID_REFRESH_TOKEN: 'AUTH.INVALID_REFRESH_TOKEN',
FORBIDDEN: 'AUTH.FORBIDDEN',
WRONG_CREDENTIALS: 'AUTH.WRONG_CREDENTIALS',
WRONG_PASSWORD_CONFIRMATION: 'AUTH.WRONG_PASSWORD_CONFIRMATION',