Skip to content

Commit 34009d4

Browse files
committed
refactor: improve logging format in profile and webauthn handlers
1 parent 97a2100 commit 34009d4

2 files changed

Lines changed: 16 additions & 3 deletions

File tree

core/src/api/profile.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,10 @@ export async function finishAddPasskey(c: Context) {
211211
return c.json({ error: "Registration verification failed" }, 400);
212212
}
213213

214-
console.log("[Profile] Registration info:", JSON.stringify(Object.keys(verification.registrationInfo)));
214+
console.log(
215+
"[Profile] Registration info:",
216+
JSON.stringify(Object.keys(verification.registrationInfo)),
217+
);
215218

216219
const {
217220
credential,

core/src/auth/webauthn.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,12 @@ export async function startRegistration(
5959
userId,
6060
});
6161

62-
console.log("[WebAuthn] Stored session for:", username, "Sessions:", Array.from(sessionStore.keys()));
62+
console.log(
63+
"[WebAuthn] Stored session for:",
64+
username,
65+
"Sessions:",
66+
Array.from(sessionStore.keys()),
67+
);
6368

6469
return options;
6570
}
@@ -69,7 +74,12 @@ export async function finishRegistration(
6974
response: RegistrationResponseJSON,
7075
config: WebAuthnConfig,
7176
): Promise<VerifiedRegistrationResponse> {
72-
console.log("[WebAuthn] Looking for session:", username, "Available:", Array.from(sessionStore.keys()));
77+
console.log(
78+
"[WebAuthn] Looking for session:",
79+
username,
80+
"Available:",
81+
Array.from(sessionStore.keys()),
82+
);
7383
const session = sessionStore.get(username);
7484
if (!session) {
7585
throw new Error("No registration session found for user");

0 commit comments

Comments
 (0)