fix: safe logout when firebase is not initialized

This commit is contained in:
2026-04-28 14:59:22 +05:00
parent fad9cacd3e
commit 3965b7891f
+5
View File
@@ -42,11 +42,16 @@ export const useAuth = () => {
}
const logout = async () => {
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 = () => {
const auth = getAuth()