From b3e96a51c7cc560d1203fa15a5f0c34a141e6b22 Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Thu, 28 Oct 2021 15:50:51 +0300 Subject: [PATCH] Auth: Human-readable error messages (#1516) --- src/api/gramjs/methods/auth.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/api/gramjs/methods/auth.ts b/src/api/gramjs/methods/auth.ts index 69060fd2b..c65806c4a 100644 --- a/src/api/gramjs/methods/auth.ts +++ b/src/api/gramjs/methods/auth.ts @@ -9,10 +9,11 @@ import { import { DEBUG } from '../../../config'; const ApiErrors: { [k: string]: string } = { - PHONE_NUMBER_INVALID: 'PHONE_NUMBER_INVALID', - PHONE_CODE_INVALID: 'PHONE_CODE_INVALID', - PASSWORD_HASH_INVALID: 'PASSWORD_HASH_INVALID', - PHONE_PASSWORD_FLOOD: 'You have tried logging in too many times', + PHONE_NUMBER_INVALID: 'Invalid phone number.', + PHONE_CODE_INVALID: 'Invalid code.', + PASSWORD_HASH_INVALID: 'Incorrect password.', + PHONE_PASSWORD_FLOOD: 'Limit exceeded. Please try again later.', + PHONE_NUMBER_BANNED: 'This phone number is banned.', }; const authController: {