Skip to content

Commit 26c805e

Browse files
committed
debug: log auth callback cookies
1 parent fe4cb99 commit 26c805e

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

apps/server/src/index.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,24 @@ app.use(
2121
}),
2222
);
2323

24-
app.on(["POST", "GET"], "/api/auth/*", (c) => auth.handler(c.req.raw));
24+
app.on(["POST", "GET"], "/api/auth/*", (c) => {
25+
const url = new URL(c.req.url);
26+
if (url.pathname.startsWith("/api/auth/callback/")) {
27+
const state = c.req.query("state");
28+
const cookieHeader = c.req.header("cookie") ?? "";
29+
const origin = c.req.header("origin");
30+
const referer = c.req.header("referer");
31+
console.info("Auth callback request", {
32+
path: url.pathname,
33+
state,
34+
cookieHeader,
35+
origin,
36+
referer,
37+
});
38+
}
39+
40+
return auth.handler(c.req.raw);
41+
});
2542

2643
app.post("/github/webhook", githubWebhookHandler);
2744

0 commit comments

Comments
 (0)