feat: finish Better Auth config

This commit is contained in:
2026-05-21 04:28:17 +07:00
parent eed376cf5b
commit d97dcc8838
3 changed files with 18 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
import { createAuthClient } from "better-auth/react";
export const authClient = createAuthClient({
baseURL: "http://localhost:3000",
});
+10
View File
@@ -0,0 +1,10 @@
import { auth } from "../../lib/auth";
import type { LoaderFunctionArgs, ActionFunctionArgs } from "react-router";
export async function loader({ request }: LoaderFunctionArgs) {
return auth.handler(request);
}
export async function action({ request }: ActionFunctionArgs) {
return auth.handler(request);
}
+3
View File
@@ -3,4 +3,7 @@ import Database from "better-sqlite3";
export const auth = betterAuth({
database: new Database("./sqlite.db"),
emailAndPassword: {
enabled: true,
},
});