import { DatabaseSync } from "node:sqlite"; import { apiKey } from "@better-auth/api-key"; import { betterAuth } from "better-auth"; import { jwt, testUtils } from "better-auth/plugins"; export const auth = betterAuth({ database: new DatabaseSync( process.env.BETTER_AUTH_DATABASE_PATH ?? "./.data/auth.sqlite", ), session: { expiresIn: 3600 * 24 * 30, // 30 days updateAge: 3600 * 24, // 1 day }, socialProviders: { google: { clientId: process.env.NUXT_GOOGLE_CLIENT_ID!, clientSecret: process.env.NUXT_GOOGLE_CLIENT_SECRET!, prompt: "select_account", }, }, plugins: [ apiKey({ rateLimit: { enabled: false, }, }), testUtils(), jwt({ jwt: { audience: process.env.NUXT_PUBLIC_API_BASE ?? "http://localhost:8080", expirationTime: "7d", }, }), ], });