Spaces:
Running
Running
Download frontend/src/store/authStore.js from ipswy/senti-beta: direct link, hf CLI and curl.
- Browser
- Download file 448 Bytes
-
https://huggingface.co/spaces/ipswy/senti-beta/resolve/main/frontend/src/store/authStore.js
- Command line
-
hf download hf://spaces/ipswy/senti-beta/frontend/src/store/authStore.js
-
curl -L -o authStore.js https://huggingface.co/spaces/ipswy/senti-beta/resolve/main/frontend/src/store/authStore.js
448 Bytes
| import { create } from 'zustand' | |
| import { persist } from 'zustand/middleware' | |
| export const useAuthStore = create( | |
| persist( | |
| (set) => ({ | |
| token: null, | |
| user: null, | |
| isAuthenticated: false, | |
| setAuth: (token, user) => set({ | |
| token, user, isAuthenticated: true | |
| }), | |
| clearAuth: () => set({ | |
| token: null, user: null, isAuthenticated: false | |
| }) | |
| }), | |
| { name: 'senti-auth' } | |
| ) | |
| ) |