Skip to content

Commit c11ee84

Browse files
committed
chore(site): apply fmt
1 parent c2c3ddf commit c11ee84

File tree

1 file changed

+22
-20
lines changed

1 file changed

+22
-20
lines changed

site/src/api/api.ts

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -457,26 +457,28 @@ class ApiMethods {
457457
};
458458

459459
logout = async (): Promise<void> => {
460-
try {
461-
// Fetch the stored ID token from the backend
462-
const response = await this.axios.get("/api/v2/users/oidc-logout");
463-
464-
// Redirect to OIDC logout after Coder logout
465-
if (response.data.oidc_logout_url) {
466-
// Coder session logout
467-
await this.axios.post("/api/v2/users/logout");
468-
469-
// OIDC logout
470-
window.location.href = response.data.oidc_logout_url;
471-
} else {
472-
// Redirect normally if no token is available
473-
console.warn("No ID token found, continuing logout without OIDC logout.");
474-
return this.axios.post("/api/v2/users/logout");
475-
}
476-
} catch (error) {
477-
console.error("Logout failed", error);
478-
return this.axios.post("/api/v2/users/logout");
479-
}
460+
try {
461+
// Fetch the stored ID token from the backend
462+
const response = await this.axios.get("/api/v2/users/oidc-logout");
463+
464+
// Redirect to OIDC logout after Coder logout
465+
if (response.data.oidc_logout_url) {
466+
// Coder session logout
467+
await this.axios.post("/api/v2/users/logout");
468+
469+
// OIDC logout
470+
window.location.href = response.data.oidc_logout_url;
471+
} else {
472+
// Redirect normally if no token is available
473+
console.warn(
474+
"No ID token found, continuing logout without OIDC logout.",
475+
);
476+
return this.axios.post("/api/v2/users/logout");
477+
}
478+
} catch (error) {
479+
console.error("Logout failed", error);
480+
return this.axios.post("/api/v2/users/logout");
481+
}
480482
};
481483

482484
getAuthenticatedUser = async () => {

0 commit comments

Comments
 (0)