Skip to content

Commit 8d7b12d

Browse files
committed
add some more logging so we can debug bad auth
1 parent 076a89d commit 8d7b12d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

api/endpoints/admin/passkeyAuth.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export const handler = async (event: APIGatewayEvent): Promise<APIGatewayProxyRe
2727
}
2828

2929
const currentTime = DateTime.now().toSeconds();
30-
if (challengeRecord.expiresAt > currentTime) {
30+
if (currentTime > challengeRecord.expiresAt) {
3131
await deleteItem(PASSKEY_CHALLENGES_TABLE, challengeRecord.id);
3232
return buildErrorResponse(event, HttpResponseStatus.BAD_REQUEST, "Challenge Expired");
3333
}
@@ -39,6 +39,9 @@ export const handler = async (event: APIGatewayEvent): Promise<APIGatewayProxyRe
3939
const storedCredentialId = parameters["/website/admin/passkeyId"];
4040
const storedPublicKey = parameters["/website/admin/publicKey"];
4141

42+
console.error(parameters);
43+
console.error(body.response, credentialIdBase64)
44+
4245
if (credentialIdBase64 !== storedCredentialId) {
4346
return buildErrorResponse(event, HttpResponseStatus.UNAUTHORIZED, "Credential not found");
4447
}

0 commit comments

Comments
 (0)