Spaces:
Running
Running
Download frontend/src/features/auth/services/authService.ts from Shadowfilebot/Bot: direct link, hf CLI and curl.
- Browser
- Download file 752 Bytes
-
https://huggingface.co/spaces/Shadowfilebot/Bot/resolve/main/frontend/src/features/auth/services/authService.ts
- Command line
-
hf download hf://spaces/Shadowfilebot/Bot/frontend/src/features/auth/services/authService.ts
-
curl -L -o authService.ts https://huggingface.co/spaces/Shadowfilebot/Bot/resolve/main/frontend/src/features/auth/services/authService.ts
752 Bytes
| import { requestJson } from '@/shared/lib/httpClient'; | |
| import { AuthUser, PublicPanelConfig } from '../types/authTypes'; | |
| export const authService = { | |
| login: (username: string, password: string) => | |
| requestJson<{ token: string; user: AuthUser }>( | |
| '/auth/login', | |
| { method: 'POST', body: JSON.stringify({ username, password }) }, | |
| false, | |
| ), | |
| register: (username: string, email: string, password: string) => | |
| requestJson<{ token: string; user: AuthUser }>( | |
| '/auth/register', | |
| { method: 'POST', body: JSON.stringify({ username, email, password }) }, | |
| false, | |
| ), | |
| getMe: () => requestJson<{ user: AuthUser }>('/auth/me'), | |
| getPublicConfig: () => requestJson<PublicPanelConfig>('/config', {}, false), | |
| }; | |