fix(auth): resolve reactivity bug and improve error handling
- Fix Vue reactivity bug in isAuthenticated computed property by reordering condition to ensure dependency tracking (!!user.value before pb.authStore.isValid) - Fix cross-tab sync onChange listener to handle logout by using nullish coalescing for undefined model - Add user-friendly error message mapping in login catch block - Export initAuth method from useAuth composable - Add auth.client.ts plugin for client-side auth initialization - Remove debug console.log statements that masked the Heisenbug - Simplify auth.client plugin tests to structural checks due to Nuxt's test environment auto-importing defineNuxtPlugin - Update test expectations for new error message behaviour
This commit is contained in:
6
app/plugins/auth.client.ts
Normal file
6
app/plugins/auth.client.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import { useAuth } from '../composables/useAuth';
|
||||
|
||||
export default defineNuxtPlugin(() => {
|
||||
const { initAuth } = useAuth();
|
||||
initAuth();
|
||||
});
|
||||
Reference in New Issue
Block a user