auth: request tracing + configurable Better Auth log level (debug OAuth flow)
This commit is contained in:
@@ -54,6 +54,12 @@ ${auth.options.socialProviders && "apple" in auth.options.socialProviders ? soci
|
||||
|
||||
const server = createServer((req, res) => {
|
||||
const url = new URL(req.url ?? "/", "http://localhost");
|
||||
if (url.pathname !== "/healthz") {
|
||||
// Request-level trace (path only, no query — avoids logging codes/tokens).
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`[req] ${req.method} ${url.pathname}`);
|
||||
res.on("finish", () => console.log(`[res] ${req.method} ${url.pathname} -> ${res.statusCode}`));
|
||||
}
|
||||
if (url.pathname === "/healthz") {
|
||||
res.writeHead(200, { "content-type": "application/json" });
|
||||
res.end('{"status":"ok"}');
|
||||
|
||||
Reference in New Issue
Block a user