Update
This commit is contained in:
@@ -5,6 +5,9 @@ export interface AuthSession {
|
||||
authenticated: boolean
|
||||
username: string | null
|
||||
expires_at: string | null
|
||||
role: 'operator' | 'guest' | null
|
||||
guest_access_enabled: boolean
|
||||
guest_project_id: string | null
|
||||
}
|
||||
|
||||
export function getAuthSession(): Promise<AuthSession> {
|
||||
@@ -15,6 +18,10 @@ 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')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user