This commit is contained in:
2026-02-06 03:16:06 +08:00
parent 9d42a45bb1
commit 5e24fa76a3
4 changed files with 51 additions and 56 deletions

View File

@@ -0,0 +1,20 @@
"use client";
import { LightButton } from "@/components/ui/buttons";
import { authClient } from "@/lib/auth-client";
import { useTranslations } from "next-intl";
import { useRouter } from "next/navigation";
export function LogoutButton() {
const t = useTranslations("profile");
const router = useRouter();
return <LightButton onClick={async () => {
authClient.signOut({
fetchOptions: {
onSuccess: () => {
router.push("/auth?redirect=/profile");
}
}
});
}}> {t("logout")}</LightButton >;
}