- POST /auth/forgot-password with welcome/reset email templates - POST /auth/reset-password with Zod validation, 4-hour tokens - Per-email rate limiting (3/hr) via Valkey, no user enumeration - Login page "Forgot password?" toggle with inline form - /reset-password page for setting new password from email link - Initial user seed sends welcome email instead of requiring password - CLI script for force-resetting passwords via kubectl exec - APP_URL env var in chart, removed INITIAL_USER_PASSWORD Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
25 lines
715 B
TypeScript
25 lines
715 B
TypeScript
import { api } from '@/lib/api-client'
|
|
|
|
interface LoginResponse {
|
|
token: string
|
|
user: {
|
|
id: string
|
|
email: string
|
|
firstName: string
|
|
lastName: string
|
|
role: string
|
|
}
|
|
}
|
|
|
|
export async function login(email: string, password: string): Promise<LoginResponse> {
|
|
return api.post<LoginResponse>('/v1/auth/login', { email, password })
|
|
}
|
|
|
|
export async function forgotPassword(email: string): Promise<{ message: string }> {
|
|
return api.post<{ message: string }>('/v1/auth/forgot-password', { email })
|
|
}
|
|
|
|
export async function resetPassword(token: string, newPassword: string): Promise<{ message: string }> {
|
|
return api.post<{ message: string }>('/v1/auth/reset-password', { token, newPassword })
|
|
}
|