diff --git a/app/composables/useAuth.ts b/app/composables/useAuth.ts index abfaa47..b58e2b2 100644 --- a/app/composables/useAuth.ts +++ b/app/composables/useAuth.ts @@ -42,10 +42,15 @@ export const useAuth = () => { } const logout = async () => { - const auth = getAuth() - await signOut(auth) - token.value = null - navigateTo('/login') + try { + const auth = getAuth() + await signOut(auth) + } catch (e) { + console.warn('[Firebase] Sign out failed or not initialized', e) + } finally { + token.value = null + navigateTo('/login') + } } const initAuth = () => {