MCPcopy Create free account
hub / github.com/TraderAlice/OpenAlice / getStatus

Function getStatus

ui/src/auth/api.ts:15–23  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

13}
14
15export async function getStatus(): Promise<AuthStatus> {
16 const res = await fetch('/api/auth/status', { credentials: 'same-origin' })
17 if (!res.ok) {
18 // If the backend can't even serve /status, treat as "auth required"
19 // pessimistically — better than locking the user out of the login page.
20 return { authed: false, tokenConfigured: true }
21 }
22 return res.json()
23}
24
25export async function login(token: string): Promise<{ ok: boolean; error?: string }> {
26 const res = await fetch('/api/auth/login', {

Callers 1

AuthProviderFunction · 0.90

Calls 1

fetchFunction · 0.50

Tested by

no test coverage detected