feat: add auth

This commit is contained in:
Max Koon
2025-10-12 16:03:28 -04:00
parent 0446893a67
commit b4d13e6a9f
17 changed files with 657 additions and 281 deletions

24
lib/auth.ts Normal file
View File

@@ -0,0 +1,24 @@
import { betterAuth } from "better-auth";
import { genericOAuth } from "better-auth/plugins";
import { expo } from "@better-auth/expo";
import { Pool } from "pg";
export const auth = betterAuth({
database: new Pool({
connectionString: process.env.DATABASE_URL,
}),
plugins: [
expo(),
genericOAuth({
config: [
{
providerId: 'koon-family',
clientId: process.env.OAUTH_CLIENT_ID!,
clientSecret: process.env.OAUTH_CLIENT_SECRET!,
discoveryUrl: process.env.OAUTH_DISCOVERY_URL!,
scopes: ["profile", "email"],
}
]
})
]
});