feat: finish Better Auth config
This commit is contained in:
@@ -0,0 +1,5 @@
|
|||||||
|
import { createAuthClient } from "better-auth/react";
|
||||||
|
|
||||||
|
export const authClient = createAuthClient({
|
||||||
|
baseURL: "http://localhost:3000",
|
||||||
|
});
|
||||||
@@ -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,4 +3,7 @@ import Database from "better-sqlite3";
|
|||||||
|
|
||||||
export const auth = betterAuth({
|
export const auth = betterAuth({
|
||||||
database: new Database("./sqlite.db"),
|
database: new Database("./sqlite.db"),
|
||||||
|
emailAndPassword: {
|
||||||
|
enabled: true,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user