fix(auth): migrate from next-auth to better-auth (#1453)
This commit is contained in:
parent
453f5bb3e6
commit
b4f595a68c
40 changed files with 668 additions and 390 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import Form from "next/form";
|
||||
|
||||
import { signOut } from "@/app/(auth)/auth";
|
||||
import { headers } from "next/headers";
|
||||
import { redirect } from "next/navigation";
|
||||
import { auth } from "@/lib/auth";
|
||||
|
||||
export const SignOutForm = () => {
|
||||
return (
|
||||
|
|
@ -8,9 +9,11 @@ export const SignOutForm = () => {
|
|||
action={async () => {
|
||||
"use server";
|
||||
|
||||
await signOut({
|
||||
redirectTo: "/",
|
||||
await auth.api.signOut({
|
||||
headers: await headers(),
|
||||
});
|
||||
|
||||
redirect("/");
|
||||
}}
|
||||
className="w-full"
|
||||
>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue