import request from '@/api/request' /** Shape of a successful POST /api/auth/login response. */ export interface LoginResponse { token: string expiresIn: string } /** * POST /api/auth/login with username + password. * Throws a normalized {@link ApiError} (from the response interceptor) on * failure — e.g. status 401 with message "invalid credentials". */ export async function loginApi( username: string, password: string, ): Promise { const { data } = await request.post('/auth/login', { username, password, }) return data }