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

Function logout

console/src/api/materialize/auth.ts:81–102  ·  view source on GitHub ↗
(logoutParams: {
  apiClient: SelfManagedApiClient;
})

Source from the content-addressed store, hash-verified

79}
80
81export async function logout(logoutParams: {
82 apiClient: SelfManagedApiClient;
83}) {
84 const { authApiBasePath } = logoutParams.apiClient;
85
86 const response = await fetch(`${authApiBasePath}/api/logout`, {
87 method: "POST",
88 headers: {
89 "Content-Type": "application/json",
90 },
91 });
92
93 const responseText = await response.text();
94
95 const isFetchFailure = !response.ok;
96 if (isFetchFailure) {
97 throw new Error(responseText, {
98 cause: { status: response.status },
99 });
100 }
101 return responseText;
102}
103
104export async function logoutAndRedirect(logoutParams: {
105 apiClient: SelfManagedApiClient;

Callers 3

handleLogoutFunction · 0.90
logoutAndRedirectFunction · 0.85
logoutAndRedirectOrThrowFunction · 0.85

Calls 1

fetchFunction · 0.50

Tested by

no test coverage detected