admin / Synapse-Cortex
publicSelf Hosted ITSM Tool with RBAC/Tenanting and MFA
Synapse-Cortex / Synapse-Cortexv2 / frontend / src / api / auth.ts
501 B · main
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | import { api } from './client' import type { Me } from './types' export interface LoginResult { status: 'ok' | 'mfa_required' | 'mfa_enroll_required' } export const authApi = { login: (email: string, password: string) => api.post<LoginResult>('/api/v1/auth/login', { email, password }), loginMfa: (code: string) => api.post<LoginResult>('/api/v1/auth/login/mfa', { code }), logout: () => api.post<{ status: string }>('/api/v1/auth/logout'), me: () => api.get<Me>('/api/v1/auth/me'), } |