Spaces:
Runtime error
Runtime error
Greg
Claude Sonnet 4.6
feat(purge): admin sees amber banner after data purge with dismiss action
309c40b Download frontend/src/store/authStore.ts from Talosware/talos-access: direct link, hf CLI and curl.
- Browser
- Download file 863 Bytes
-
https://huggingface.co/spaces/Talosware/talos-access/resolve/main/frontend/src/store/authStore.ts
- Command line
-
hf download hf://spaces/Talosware/talos-access/frontend/src/store/authStore.ts
-
curl -L -o authStore.ts https://huggingface.co/spaces/Talosware/talos-access/resolve/main/frontend/src/store/authStore.ts
863 Bytes
| import { create } from 'zustand' | |
| import { persist } from 'zustand/middleware' | |
| interface AuthState { | |
| token: string | null | |
| user: { | |
| id: number | |
| account_id: number | |
| email: string | |
| name: string | |
| lastname: string | |
| role: string | |
| plan: string | |
| organization_name?: string | |
| self_checkin_enabled: boolean | |
| checkin_mode: string | |
| permissions: string[] | |
| account_purged_at?: string | null | |
| } | null | |
| setAuth: (token: string, user: AuthState['user']) => void | |
| clearAuth: () => void | |
| isAuthenticated: () => boolean | |
| } | |
| export const useAuthStore = create<AuthState>()( | |
| persist( | |
| (set, get) => ({ | |
| token: null, | |
| user: null, | |
| setAuth: (token, user) => set({ token, user }), | |
| clearAuth: () => set({ token: null, user: null }), | |
| isAuthenticated: () => !!get().token, | |
| }), | |
| { name: 'talos-auth' }, | |
| ), | |
| ) | |