Skip to content

Commit 239ae31

Browse files
committed
chore(site): apply fmt
1 parent b1c1ee3 commit 239ae31

File tree

1 file changed

+22
-20
lines changed

1 file changed

+22
-20
lines changed

site/src/api/api.ts

+22-20
Original file line numberDiff line numberDiff line change
@@ -430,26 +430,28 @@ class ApiMethods {
430430
};
431431

432432
logout = async (): Promise<void> => {
433-
try {
434-
// Fetch the stored ID token from the backend
435-
const response = await this.axios.get("/api/v2/users/oidc-logout");
436-
437-
// Redirect to OIDC logout after Coder logout
438-
if (response.data.oidc_logout_url) {
439-
// Coder session logout
440-
await this.axios.post("/api/v2/users/logout");
441-
442-
// OIDC logout
443-
window.location.href = response.data.oidc_logout_url;
444-
} else {
445-
// Redirect normally if no token is available
446-
console.warn("No ID token found, continuing logout without OIDC logout.");
447-
return this.axios.post("/api/v2/users/logout");
448-
}
449-
} catch (error) {
450-
console.error("Logout failed", error);
451-
return this.axios.post("/api/v2/users/logout");
452-
}
433+
try {
434+
// Fetch the stored ID token from the backend
435+
const response = await this.axios.get("/api/v2/users/oidc-logout");
436+
437+
// Redirect to OIDC logout after Coder logout
438+
if (response.data.oidc_logout_url) {
439+
// Coder session logout
440+
await this.axios.post("/api/v2/users/logout");
441+
442+
// OIDC logout
443+
window.location.href = response.data.oidc_logout_url;
444+
} else {
445+
// Redirect normally if no token is available
446+
console.warn(
447+
"No ID token found, continuing logout without OIDC logout.",
448+
);
449+
return this.axios.post("/api/v2/users/logout");
450+
}
451+
} catch (error) {
452+
console.error("Logout failed", error);
453+
return this.axios.post("/api/v2/users/logout");
454+
}
453455
};
454456

455457
getAuthenticatedUser = async () => {

0 commit comments

Comments
 (0)