Skip to content

Commit

Permalink
🐛 fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nrmnqdds committed Oct 6, 2024
1 parent af5ac13 commit 15cc0da
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 54 deletions.
9 changes: 9 additions & 0 deletions app/api/logout/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { cookies } from "next/headers";
import { NextResponse } from "next/server";

export async function DELETE() {
// Clear the cookie
cookies().delete("MOD_AUTH_CAS");

return NextResponse.redirect("/");
}
45 changes: 0 additions & 45 deletions components/LogoutButton.tsx

This file was deleted.

14 changes: 5 additions & 9 deletions components/ProfileDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,11 @@ export default function ProfileDropdown() {

<DropdownMenuItem
className="cursor-pointer focus:bg-red-600/50"
// onClick={async () => {
// const res = await ImaluumLogout();
// if (res.success) {
// localStorage.clear();
// queryClient.invalidateQueries();
// toast.success("Logged out successfully.");
// router.replace("/");
// }
// }}
onClick={async () => {
await fetch("/api/logout", {
method: "DELETE",
});
}}
>
Log out
</DropdownMenuItem>
Expand Down

0 comments on commit 15cc0da

Please sign in to comment.