Catalyst / admin/Synapse-Cortex 14.8 GB / 57.8 GB 40.0 GB free
Help Sign in

admin / Synapse-Cortex

public

Self Hosted ITSM Tool with RBAC/Tenanting and MFA

Code Issues Pull requests Pipelines Packages Security Insights Wiki Settings
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'),
}