feat: Implement user authentication, admin user management, and role-based access control.
This commit is contained in:
parent
8a2ca592bc
commit
38648581ec
19 changed files with 1762 additions and 514 deletions
11
frontend_management/plugins/01.auth.ts
Normal file
11
frontend_management/plugins/01.auth.ts
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
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();
|
||||
}
|
||||
});
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
export default defineNuxtPlugin(() => {
|
||||
const authStore = useAuthStore();
|
||||
|
||||
// Restore auth state from localStorage before any navigation
|
||||
if (process.client) {
|
||||
authStore.checkAuth();
|
||||
}
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue