MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / hasActiveSession

Function hasActiveSession

console/src/api/materialize/auth.ts:64–79  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

62}
63
64export async function hasActiveSession(): Promise<boolean> {
65 const { authApiBasePath } = getApiClient();
66
67 try {
68 const response = await fetch(`${authApiBasePath}/api/sql`, {
69 method: "POST",
70 headers: {
71 "Content-Type": "application/json",
72 },
73 body: JSON.stringify({ queries: [{ query: "SELECT 1", params: [] }] }),
74 });
75 return response.ok;
76 } catch {
77 return false;
78 }
79}
80
81export async function logout(logoutParams: {
82 apiClient: SelfManagedApiClient;

Callers

nothing calls this directly

Calls 2

getApiClientFunction · 0.85
fetchFunction · 0.50

Tested by

no test coverage detected