FEAT: terms of use

This commit is contained in:
Arthur Simas
2022-07-11 02:13:33 -03:00
parent cc3b34d87e
commit db78ee3d8b
8 changed files with 127 additions and 8 deletions
+8
View File
@@ -86,6 +86,14 @@ export function EnrichErrorCode(code: string) {
code,
};
case ErrorCodes.TERMS_OF_USE.REQUIRED:
return {
statusCode: HttpStatus.FORBIDDEN,
error: 'Não autorizado',
message: 'É necessário aceitar os termos de uso para prosseguir',
code,
};
case ErrorCodes.RATE_LIMIT:
return {
statusCode: HttpStatus.TOO_MANY_REQUESTS,
+5
View File
@@ -14,11 +14,16 @@ export const AUTH = {
WEAK_NEW_PASSWORD: 'AUTH.WEAK_NEW_PASSWORD',
};
const TERMS_OF_USE = {
REQUIRED: 'TERMS_OF_USE.REQUIRED',
};
const ErrorCodes = {
UNKNOWN: 'UNKNOWN',
RATE_LIMIT: 'RATE_LIMIT',
INTERNAL: 'INTERNAL',
AUTH,
TERMS_OF_USE,
};
export default ErrorCodes;