Merge branch 'workstream-i'

This commit is contained in:
RevIQ
2026-01-09 18:12:45 +08:00
30 changed files with 2365 additions and 9 deletions

View File

@@ -157,7 +157,7 @@ export const verifyRegistration = async (
userId: number,
challengeId: number,
response: RegistrationResponseJSON,
): Promise<void> => {
): Promise<{ passkeyId: number }> => {
// Fetch the challenge
const challengeRow = await db
.selectFrom("webauthn_challenges")
@@ -207,7 +207,7 @@ export const verifyRegistration = async (
guidName ?? `Key registered at ${formatPasskeyDate(new Date())}`;
// Store the passkey
await db
const { id: passkeyId } = await db
.insertInto("passkeys")
.values({
user_id: userId,
@@ -222,7 +222,10 @@ export const verifyRegistration = async (
rpid: rpInfo.rpID,
name: passKeyName,
})
.execute();
.returning("id")
.executeTakeFirstOrThrow();
return { passkeyId: Number(passkeyId) };
};
/**