elearning/frontend_management/plugins/01.auth.ts

12 lines
297 B
TypeScript
Raw Normal View History

export default defineNuxtPlugin({
name: 'auth-restore',
parallel: false,
setup() {
const authStore = useAuthStore();
// Restore auth state from cookies on app initialization
// useCookie works on both server and client
authStore.checkAuth();
}
});