Fix: remove debug logging from nextauth

This commit is contained in:
shamoon
2026-07-13 09:49:45 -07:00
parent b0749e95d2
commit 126d4ac341
2 changed files with 63 additions and 8 deletions
+8 -7
View File
@@ -3,6 +3,8 @@ import { timingSafeEqual } from "node:crypto";
import NextAuth from "next-auth";
import CredentialsProvider from "next-auth/providers/credentials";
import createLogger from "utils/logger";
const authEnabled = Boolean(process.env.HOMEPAGE_AUTH_ENABLED);
const issuer = process.env.HOMEPAGE_OIDC_ISSUER;
const clientId = process.env.HOMEPAGE_OIDC_CLIENT_ID;
@@ -100,16 +102,15 @@ export const authOptions = {
pages: {
signIn: "/auth/signin",
},
debug: true,
logger: {
error: (...args) => console.error("[nextauth][error]", ...args),
warn: (...args) => console.warn("[nextauth][warn]", ...args),
debug: (...args) => console.debug("[nextauth][debug]", ...args),
error: (code) => createLogger("nextauth").error("%s", code),
warn: (code) => createLogger("nextauth").warn("%s", code),
debug: (code) => createLogger("nextauth").debug("%s", code),
},
events: {
signIn: async (message) => console.debug("[nextauth][event][signIn]", message),
signOut: async (message) => console.debug("[nextauth][event][signOut]", message),
error: async (message) => console.error("[nextauth][event][error]", message),
signIn: async ({ account }) =>
createLogger("nextauth").debug("Sign in via provider '%s'", account?.provider ?? "unknown"),
signOut: async () => createLogger("nextauth").debug("Sign out"),
},
};