import apiRequest from './client' export interface Setup2FAResponse { secret: string qr_code: string } export interface Verify2FAResponse { message: string recovery_codes: string[] } export interface RegenerateCodesResponse { recovery_codes: string[] } export async function setup2FA(): Promise { return apiRequest('/auth/2fa/setup', { method: 'POST', }) } export async function verify2FA(code: string): Promise { return apiRequest('/auth/2fa/verify', { method: 'POST', body: JSON.stringify({ code }), }) } export async function disable2FA(passwordDerived: string): Promise { return apiRequest('/auth/2fa/disable', { method: 'POST', body: JSON.stringify({ password: passwordDerived }), }) } export async function regenerateRecoveryCodes(passwordDerived: string): Promise { return apiRequest('/auth/2fa/recovery', { method: 'POST', body: JSON.stringify({ password: passwordDerived }), }) }