From 85207f8ad2ab2365c73058288d99976baad7a6f6 Mon Sep 17 00:00:00 2001 From: Irwan Cahyono Date: Fri, 8 Aug 2025 00:35:28 +0700 Subject: [PATCH] login --- stores/auth.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/stores/auth.ts b/stores/auth.ts index f1d0a26..351ae13 100644 --- a/stores/auth.ts +++ b/stores/auth.ts @@ -36,8 +36,9 @@ export const useAuthStore = defineStore('auth', () => { return true; } catch (error: any) { - console.error('Login failed', error) - throw new Error(error) + console.error('Login failed', error); + const message = error?.data?.detail || error?.message || 'Unknown error during login'; + throw new Error(message); } }