mirror of
https://github.com/jakejarvis/sofa.git
synced 2026-08-29 02:45:39 -04:00
Add LOG_LEVEL logger helper with createLogger() utility
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -9,6 +9,7 @@ import {
|
||||
isPasswordLoginDisabled,
|
||||
} from "@/lib/config";
|
||||
import { db } from "@/lib/db/client";
|
||||
import { createLogger } from "@/lib/logger";
|
||||
import {
|
||||
getUserCount,
|
||||
isRegistrationOpen,
|
||||
@@ -36,7 +37,18 @@ const oidcPlugin = isOidcConfigured()
|
||||
]
|
||||
: [];
|
||||
|
||||
const authLog = createLogger("auth");
|
||||
|
||||
export const auth = betterAuth({
|
||||
logger: {
|
||||
// Suppress unset secret/low entropy warnings during build
|
||||
disabled: process.env.NEXT_PHASE === "phase-production-build",
|
||||
level: "debug",
|
||||
log: (level, message, ...args) => {
|
||||
const fn = authLog[level as keyof typeof authLog];
|
||||
if (fn) fn(message, ...args);
|
||||
},
|
||||
},
|
||||
database: drizzleAdapter(db, {
|
||||
provider: "sqlite",
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user