summaryrefslogtreecommitdiffstats
path: root/src/features/auth/hooks/useLogin.ts
diff options
context:
space:
mode:
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);
}