feat: v1.1 - random re-roll, shopping summary, offline PWA, auth prep, profile page
This commit is contained in:
21
frontend/src/api/auth.ts
Normal file
21
frontend/src/api/auth.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
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')
|
||||
}
|
||||
Reference in New Issue
Block a user