feat: Init project with frontend and rudimentary authentication

This commit is contained in:
2025-02-07 15:44:04 +01:00
commit 84e701131f
20 changed files with 7054 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
import { auth } from "../../utils/auth";
import {H3Event} from "h3";
export default defineEventHandler((event: H3Event) => {
return auth.handler(toWebRequest(event));
});

View File

@@ -0,0 +1,3 @@
{
"extends": "../.nuxt/tsconfig.server.json"
}

View File

@@ -0,0 +1,11 @@
import { betterAuth } from "better-auth";
import Database from "better-sqlite3";
export const auth = betterAuth({
database: new Database("./sqlite.db"),
emailAndPassword: { enabled: true, autoSignIn: false },
user: { modelName: "better_auth_user" },
session: { modelName: "better_auth_session" },
account: { modelName: "better_auth_account" },
verification: { modelName: "better_auth_verification" },
});