initial commit

This commit is contained in:
René Schober
2026-03-13 06:23:06 +01:00
commit 4e34270786
314 changed files with 37280 additions and 0 deletions

34
packages/auth/.gitignore vendored Normal file
View File

@@ -0,0 +1,34 @@
# dependencies (bun install)
node_modules
# output
out
dist
*.tgz
# code coverage
coverage
*.lcov
# logs
logs
_.log
report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json
# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local
# caches
.eslintcache
.cache
*.tsbuildinfo
# IntelliJ based IDEs
.idea
# Finder (MacOS) folder config
.DS_Store

View File

@@ -0,0 +1,25 @@
{
"name": "@haushaltsApp/auth",
"type": "module",
"exports": {
".": {
"default": "./src/index.ts"
},
"./*": {
"default": "./src/*.ts"
}
},
"scripts": {},
"dependencies": {
"@better-auth/expo": "catalog:",
"@haushaltsApp/db": "workspace:*",
"@haushaltsApp/env": "workspace:*",
"better-auth": "catalog:",
"dotenv": "catalog:",
"zod": "catalog:"
},
"devDependencies": {
"@haushaltsApp/config": "workspace:*",
"typescript": "^5"
}
}

View File

@@ -0,0 +1,34 @@
import { expo } from "@better-auth/expo";
import { db } from "@haushaltsApp/db";
import * as schema from "@haushaltsApp/db/schema/auth";
import { env } from "@haushaltsApp/env/server";
import { betterAuth } from "better-auth";
import { drizzleAdapter } from "better-auth/adapters/drizzle";
export const auth = betterAuth({
database: drizzleAdapter(db, {
provider: "pg",
schema: schema,
}),
trustedOrigins: [
env.CORS_ORIGIN,
"haushaltsApp://",
...(env.NODE_ENV === "development"
? ["exp://", "exp://**", "exp://192.168.*.*:*/**", "http://localhost:8081"]
: []),
],
emailAndPassword: {
enabled: true,
},
secret: env.BETTER_AUTH_SECRET,
baseURL: env.BETTER_AUTH_URL,
advanced: {
defaultCookieAttributes: {
sameSite: "none",
secure: true,
httpOnly: true,
},
},
plugins: [expo()],
});

View File

@@ -0,0 +1,10 @@
{
"extends": "@haushaltsApp/config/tsconfig.base.json",
"compilerOptions": {
"declaration": true,
"declarationMap": true,
"sourceMap": true,
"outDir": "dist",
"composite": true
}
}