feat(admin): implement Phase 3 Admin SPA Router and Dual-Token Auth integration
This commit is contained in:
1 parent
71e19bfe43
commit
eaa2621a17
11 files changed
+561
-153
No files matched your search
@@ -0,0 +1,22 @@
|
||||
import { create } from 'zustand';
|
||||
import type { AuthState, AdminUser } from '../types/admin';
|
||||
|
||||
export const useAdminAuthStore = create<AuthState>((set) => ({
|
||||
accessToken: null,
|
||||
adminUser: null,
|
||||
isAuthenticated: false,
|
||||
|
||||
setAuth: (accessToken: string, adminUser: AdminUser) =>
|
||||
set({
|
||||
accessToken,
|
||||
adminUser,
|
||||
isAuthenticated: true,
|
||||
}),
|
||||
|
||||
clearAuth: () =>
|
||||
set({
|
||||
accessToken: null,
|
||||
adminUser: null,
|
||||
isAuthenticated: false,
|
||||
}),
|
||||
}));
|
||||
Reference in new issue
Block a user