import client from '../client'; export interface User { id: string; username: string; role: string; first_name?: string; last_name?: string; email?: string; mfa_enabled?: boolean; timezone?: string; auth_provider?: string; } export interface LoginResponse { token?: string; user?: User; mfa_required?: boolean; mfa_setup?: boolean; totp_uri?: string; } export const authApi = { login: (username: string, password: string, totp_code?: string) => client.post('/auth/login', { username, password, ...(totp_code && { totp_code }) }), logout: () => client.post('/auth/logout'), me: () => client.get('/users/me'), changePassword: (current_password: string, new_password: string) => client.post('/auth/change-password', { current_password, new_password }), };