fix(auth): migrate from next-auth to better-auth (#1453)

This commit is contained in:
dancer 2026-03-13 23:18:01 +00:00 committed by GitHub
parent 453f5bb3e6
commit b4f595a68c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
40 changed files with 668 additions and 390 deletions

9
lib/client.ts Normal file
View file

@ -0,0 +1,9 @@
import { anonymousClient } from "better-auth/client/plugins";
import { createAuthClient } from "better-auth/react";
export const authClient = createAuthClient({
basePath: `${process.env.NEXT_PUBLIC_BASE_PATH ?? ""}/api/auth`,
plugins: [anonymousClient()],
});
export const { useSession, signIn, signUp, signOut } = authClient;