From c62d048fba0f8d1a607896ffd3238ff0fcda8fc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Munsch?= Date: Wed, 13 Sep 2023 11:29:05 +0200 Subject: [PATCH] fix login verify method --- ComApp/src/App/Controllers/LoginController.js | 4 ++-- ComApp/src/App/Views/LoginScreen.js | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/ComApp/src/App/Controllers/LoginController.js b/ComApp/src/App/Controllers/LoginController.js index 5f3b248..c42c228 100644 --- a/ComApp/src/App/Controllers/LoginController.js +++ b/ComApp/src/App/Controllers/LoginController.js @@ -4,8 +4,8 @@ import { Setting } from '../../Database'; import { verify } from 'react-native-b-crypt-bridge'; class LoginController { - verify(user, password) { - return verify(password, user.password); + async verify(user, password) { + return await verify(password, user.password); } login(user) { diff --git a/ComApp/src/App/Views/LoginScreen.js b/ComApp/src/App/Views/LoginScreen.js index 49fec96..6d8b18f 100644 --- a/ComApp/src/App/Views/LoginScreen.js +++ b/ComApp/src/App/Views/LoginScreen.js @@ -122,9 +122,7 @@ class LoginScreen extends React.Component { Alert.alert(i18n.t('error.error'), i18n.t('error.incorrect_credentials')); return; } - const verified = LoginController.verify(user, password).then( - verified => verified, - ); + const verified = await LoginController.verify(user, password); if (!verified) { Alert.alert(i18n.t('error.error'), i18n.t('error.incorrect_credentials')); return;