将next-auth替换为better-auth

This commit is contained in:
2025-12-10 17:54:14 +08:00
parent db96b86e65
commit 881d9ca921
45 changed files with 2225 additions and 623 deletions

View File

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