22 lines
618 B
TypeScript
22 lines
618 B
TypeScript
import { apiFetch } from './client'
|
|
|
|
// v2: Auth API — placeholder functions
|
|
|
|
export interface User {
|
|
id: string
|
|
name: string
|
|
email?: string
|
|
}
|
|
|
|
export function login(_email: string, _password: string) {
|
|
return apiFetch<User>('/auth/login', { method: 'POST', body: JSON.stringify({ email: _email, password: _password }) })
|
|
}
|
|
|
|
export function register(_email: string, _password: string, _name: string) {
|
|
return apiFetch<User>('/auth/register', { method: 'POST', body: JSON.stringify({ email: _email, password: _password, name: _name }) })
|
|
}
|
|
|
|
export function fetchMe() {
|
|
return apiFetch<User>('/auth/me')
|
|
}
|