feat: add operator landing and login
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import { apiGet, apiPost } from './client'
|
||||
|
||||
export interface AuthSession {
|
||||
authentication_required: boolean
|
||||
authenticated: boolean
|
||||
username: string | null
|
||||
expires_at: 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 logout(): Promise<AuthSession> {
|
||||
return apiPost<AuthSession>('/api/v1/auth/logout')
|
||||
}
|
||||
Reference in New Issue
Block a user