summaryrefslogtreecommitdiffstats
path: root/src/features/auth/hooks/useLogin.ts
diff options
context:
space:
mode:
authorAlberto Duarte Delgado <alberto@albertoduarte.com>2026-04-01 13:03:25 +0100
committerAlberto Duarte Delgado <alberto@albertoduarte.com>2026-04-01 13:03:25 +0100
commit08ce78dbd97ad792e163482f454f285557c7cdd0 (patch)
tree998ce8d7d48f8344d9ec34691809f2482cde5136 /src/features/auth/hooks/useLogin.ts
parentc927739f8f221feabb6e19af2c2667eda905a2eb (diff)
Mejoras de UX y feedback de errores; y, manejo de status de reserva
Diffstat (limited to 'src/features/auth/hooks/useLogin.ts')
-rw-r--r--src/features/auth/hooks/useLogin.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/features/auth/hooks/useLogin.ts b/src/features/auth/hooks/useLogin.ts
index 5e4c881..6af76c5 100644
--- a/src/features/auth/hooks/useLogin.ts
+++ b/src/features/auth/hooks/useLogin.ts
@@ -1,6 +1,7 @@
import { useState } from 'react';
import { router } from 'expo-router';
import { authService } from '@/features/auth/services/authService';
+import { getErrorMessage } from '@/shared/lib/errors/getErrorMessage';
export function useLogin() {
const [email, setEmail] = useState('');
@@ -19,8 +20,8 @@ export function useLogin() {
});
router.replace('/(protected)/home');
- } catch (err: any) {
- setError(err?.message ?? 'No se pudo iniciar sesión');
+ } catch (err) {
+ setError(getErrorMessage(err, 'No se pudo iniciar sesión'));
} finally {
setIsSubmitting(false);
}