From 047510625294d228dd016bc021cefb87a018f98a Mon Sep 17 00:00:00 2001 From: LucasBrazi06 Date: Wed, 17 Nov 2021 11:17:50 +0100 Subject: [PATCH] Technical User cannot login to the App --- src/I18n/languages/cz.json | 1 + src/I18n/languages/de.json | 1 + src/I18n/languages/en.json | 1 + src/I18n/languages/es.json | 1 + src/I18n/languages/fr.json | 1 + src/I18n/languages/it.json | 1 + src/I18n/languages/pt.json | 1 + src/screens/auth/login/Login.tsx | 10 +++++++--- src/types/HTTPError.tsx | 1 + 9 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/I18n/languages/cz.json b/src/I18n/languages/cz.json index 7d819ed49..9aa0903d1 100644 --- a/src/I18n/languages/cz.json +++ b/src/I18n/languages/cz.json @@ -118,6 +118,7 @@ "registerUnexpectedError": "Nelze vytvořit účet", "accountLocked": "Váš účet je zablokován", "accountNotActive": "Váš účet není aktivní", + "technicalUserCannotLoginToUI": "Technical user and cannot login using the application", "accountAlreadyActive": "Váš účet je již aktivní", "accountVerifiedSuccess": "Váš účet byl úspěšně aktivován!", "accountPending": "Váš účet čeká na vyřízení! Zkontrolujte svůj e-mail", diff --git a/src/I18n/languages/de.json b/src/I18n/languages/de.json index b91e069a3..d29a5d399 100644 --- a/src/I18n/languages/de.json +++ b/src/I18n/languages/de.json @@ -118,6 +118,7 @@ "registerUnexpectedError": "Neuen Account erstellen", "emailAlreadyExists": "Email existiert bereits", "accountNotActive": "Ihr Konto ist nicht aktiv", + "technicalUserCannotLoginToUI": "Technical user and cannot login using the application", "accountAlreadyActive": "Ihr Account ist bereits aktiviert", "accountVerifiedSuccess": "Ihr Account wurde erfolgreich aktiviert!", "accountPending": "Ihr Konto wurde noch nicht aktiviert, überprüfen Sie Ihre E-Mails!", diff --git a/src/I18n/languages/en.json b/src/I18n/languages/en.json index c3dfeb170..23103c478 100644 --- a/src/I18n/languages/en.json +++ b/src/I18n/languages/en.json @@ -118,6 +118,7 @@ "registerUnexpectedError": "Cannot create account", "accountLocked": "Your account is locked", "accountNotActive": "Your account is not active", + "technicalUserCannotLoginToUI": "Technical user and cannot login using the application", "accountAlreadyActive": "Your account is already active", "accountVerifiedSuccess": "Your account has been activated with success!", "accountPending": "Your account is pending! Check your e-mail", diff --git a/src/I18n/languages/es.json b/src/I18n/languages/es.json index 32d55acf3..c096b44ed 100644 --- a/src/I18n/languages/es.json +++ b/src/I18n/languages/es.json @@ -118,6 +118,7 @@ "registerUnexpectedError": "No se ha podido crear la cuenta", "accountLocked": "Su cuenta ha sido bloqueada", "accountNotActive": "Su cuenta no ha sido activada", + "technicalUserCannotLoginToUI": "Technical user and cannot login using the application", "accountAlreadyActive": "Su cuenta ya ha sido activada", "accountVerifiedSuccess": "¡Su cuenta ha sido activada exitosamente!", "accountPending": "¡Su cuenta está pendiente! Revise su correo electrónico", diff --git a/src/I18n/languages/fr.json b/src/I18n/languages/fr.json index cec724735..371f1e46b 100644 --- a/src/I18n/languages/fr.json +++ b/src/I18n/languages/fr.json @@ -118,6 +118,7 @@ "registerUnexpectedError": "Impossible de créer le compte", "accountLocked": "Votre compte est bloqué", "accountNotActive": "Votre compte est inactif", + "technicalUserCannotLoginToUI": "Un utilisateur technique ne peut pas se connecter en utilisant l'application", "accountAlreadyActive": "Votre compte a déjà été activé", "accountVerifiedSuccess": "Votre compte a été activé avec succès!", "accountPending": "Votre compte n'est pas activé! Vérifiez vos e-mails", diff --git a/src/I18n/languages/it.json b/src/I18n/languages/it.json index b79a19134..c0464287d 100644 --- a/src/I18n/languages/it.json +++ b/src/I18n/languages/it.json @@ -118,6 +118,7 @@ "registerUnexpectedError": "Non posso creare un'account", "accountLocked": "Il tuo account è bloccato", "accountNotActive": "Il tuo account non è attivo", + "technicalUserCannotLoginToUI": "Technical user and cannot login using the application", "accountAlreadyActive": "Il tuo account è già attivo", "accountVerifiedSuccess": "Il tuo account è stato attivato con successo!", "accountPending": "Il tuo account è in sospeso! Controlla la tua email", diff --git a/src/I18n/languages/pt.json b/src/I18n/languages/pt.json index 54bbb9b83..f1aa4a110 100644 --- a/src/I18n/languages/pt.json +++ b/src/I18n/languages/pt.json @@ -118,6 +118,7 @@ "registerUnexpectedError": "A conta não pode ser criada", "accountLocked": "A sua conta está bloqueada", "accountNotActive": "A sua conta não está ativa", + "technicalUserCannotLoginToUI": "Technical user and cannot login using the application", "accountAlreadyActive": "A sua conta já está ativa", "accountVerifiedSuccess": "A sua conta foi ativada com sucesso!", "accountPending": "A sua conta está pendendte! Por favor Verifique o seu email", diff --git a/src/screens/auth/login/Login.tsx b/src/screens/auth/login/Login.tsx index 74767a537..c12c51c24 100644 --- a/src/screens/auth/login/Login.tsx +++ b/src/screens/auth/login/Login.tsx @@ -11,6 +11,9 @@ import { TouchableOpacity } from 'react-native'; +import DialogModal from '../../../components/modal/DialogModal'; +import ExitAppDialog from '../../../components/modal/exit-app/ExitAppDialog'; +import computeModalCommonStyle from '../../../components/modal/ModalCommonStyle'; import computeFormStyleSheet from '../../../FormStyles'; import BaseProps from '../../../types/BaseProps'; import { HTTPError } from '../../../types/HTTPError'; @@ -21,9 +24,6 @@ import Utils from '../../../utils/Utils'; import BaseScreen from '../../base-screen/BaseScreen'; import AuthHeader from '../AuthHeader'; import computeStyleSheet from '../AuthStyles'; -import computeModalCommonStyle from '../../../components/modal/ModalCommonStyle'; -import ExitAppDialog from '../../../components/modal/exit-app/ExitAppDialog'; -import DialogModal from '../../../components/modal/DialogModal'; export interface Props extends BaseProps {} @@ -269,6 +269,10 @@ export default class Login extends BaseScreen { case HTTPError.USER_ACCOUNT_INACTIVE_ERROR: Message.showError(I18n.t('authentication.accountNotActive')); break; + // Technical User + case HTTPError.TECHNICAL_USER_CANNOT_LOG_TO_UI_ERROR: + Message.showError(I18n.t('authentication.technicalUserCannotLoginToUI')); + break; // Account Pending case HTTPError.USER_ACCOUNT_PENDING_ERROR: Message.showError(I18n.t('authentication.accountPending')); diff --git a/src/types/HTTPError.tsx b/src/types/HTTPError.tsx index 636a4b158..c0e26fb8e 100644 --- a/src/types/HTTPError.tsx +++ b/src/types/HTTPError.tsx @@ -37,6 +37,7 @@ export enum HTTPError { USER_ACCOUNT_CHANGED = 595, TENANT_COMPONENT_CHANGED = 596, TENANT_ALREADY_EXIST = 597, + TECHNICAL_USER_CANNOT_LOG_TO_UI_ERROR = 598, INVALID_CAPTCHA = 530, INVALID_TOKEN_ERROR = 540,