13 lines
296 B
TypeScript
13 lines
296 B
TypeScript
"use client";
|
|
|
|
import { authClient } from "@/lib/auth-client";
|
|
import { redirect } from "next/navigation";
|
|
|
|
export default function Logout() {
|
|
const handleLogout = async () => {
|
|
await authClient.signOut();
|
|
redirect("/");
|
|
};
|
|
|
|
return <button onClick={handleLogout}>Logout</button>;
|
|
}
|