17 lines
415 B
TypeScript
17 lines
415 B
TypeScript
import { clientFetch } from '@/lib/api/client';
|
|
import type { AuthTokens, LoginDto, User } from '../types';
|
|
|
|
export const AuthClientApi = {
|
|
login: (dto: LoginDto) =>
|
|
clientFetch<AuthTokens>('/auth/login', {
|
|
method: 'POST',
|
|
body: JSON.stringify(dto),
|
|
}),
|
|
|
|
logout: () =>
|
|
clientFetch<void>('/auth/logout', { method: 'POST' }),
|
|
|
|
getCurrentUser: () =>
|
|
clientFetch<User>('/auth/me'),
|
|
};
|