Skip to content

Commit def56de

Browse files
author
Ajit Kumar
committed
fix: correct logout error handling in AuthService
1 parent 94a74d6 commit def56de

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

src/lib/auth.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,7 @@ class AuthService {
7979
const res = await fetch(`${config.API_BASE}/login`, {
8080
method: "DELETE",
8181
});
82-
if (res.ok) {
83-
userContextMenu.el.classList.remove("active");
84-
document.removeEventListener("click", handleClickOutside);
85-
toast("Logged out successfully");
86-
updateSidebarAvatar();
87-
} else {
82+
if (!res.ok) {
8883
throw new Error("Unable to logout.");
8984
}
9085
} catch (error) {

0 commit comments

Comments
 (0)