Files
geointel/frontend/src/services/api/auth.ts
T
Jens 4fdc3aa11b
GeoIntel release gates / Compile, test, contracts and builds (push) Failing after 1m51s
GeoIntel release gates / Python and npm vulnerability policy (push) Failing after 40s
GeoIntel release gates / GIS image, SBOM and container scan (push) Failing after 2m18s
preserve Tower Authentik operator login WIP
2026-08-30 03:05:29 +02:00

29 lines
812 B
TypeScript

import { apiGet, apiPost } from './client'
export interface AuthSession {
authentication_required: boolean
authenticated: boolean
username: string | null
expires_at: string | null
role: 'operator' | 'guest' | null
guest_access_enabled: boolean
authentik_enabled?: boolean
guest_project_id: string | null
}
export function getAuthSession(): Promise<AuthSession> {
return apiGet<AuthSession>('/api/v1/auth/session')
}
export function login(username: string, password: string): Promise<AuthSession> {
return apiPost<AuthSession>('/api/v1/auth/login', { username, password })
}
export function loginAsGuest(): Promise<AuthSession> {
return apiPost<AuthSession>('/api/v1/auth/guest')
}
export function logout(): Promise<AuthSession> {
return apiPost<AuthSession>('/api/v1/auth/logout')
}