/
afanasevn
/
MaxSystems
Обзор
Документация
Войти
/
afanasevn
/
MaxSystems
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
client/src/api/auth.ts
27 строк
553 B
IBS\NAfanasev
Production tests added
30 июн 2026, 13:52
30 июн 2026, 13:52
919fb54
Код
Авторство
О чём код?
import type { UserRole } from './admin' import { apiGet, apiPost } from './http' export type UserProfile = { id: string email: string name: string role: UserRole } export type LoginResponse = { token: string user: UserProfile } export type LoginRequest = { email: string password: string } export async function login(request: LoginRequest): Promise<LoginResponse> { return apiPost<LoginResponse>('/api/auth/login', request) } export async function fetchMe(): Promise<UserProfile> { return apiGet<UserProfile>('/api/auth/me') }