© 2026 Hedgehog Software, LLC
export const auth = betterAuth({ emailAndPassword: {enabled: true}, database: new Pool({connectionString: process.env.DATABASE_URL}), plugins: [nextCookies(), jwt(), oidcProvider({ loginPage: '/auth/sign-in', consentPage: '/oidc/consent', defaultScope: 'openid email', allowDynamicClientRegistration: true })] });
/api/oidc/callback
await oauth2.register({ name: clientName, redirectURLs: ['http://localhost:3000/api/oidc/callback'] });
http://localhost:3000/api/auth/oauth2/authorize?response_type=code&client_id=<redacted>&redirect_uri=http%3A%2F%2Flocalhost%3A3000%2Fapi%2Foidc%2Fcallback
http://localhost:3000/auth/sign-in?response_type=code&client_id=<redacted>&redirect_uri=http%3A%2F%2Flocalhost%3A3000%2Fapi%2Foidc%2Fcallback
authClient.signIn.email()