diff --git a/routes/api/webauthn/login/[step].ts b/routes/api/webauthn/login/[step].ts index d5b70bf..2c95765 100644 --- a/routes/api/webauthn/login/[step].ts +++ b/routes/api/webauthn/login/[step].ts @@ -118,8 +118,7 @@ export const handler: SessionHandlers = { } const { newCounter } = authenticationInfo - - passkey.counter = newCounter + const newPasskey = { ...passkey, counter: newCounter } // Update credential store const [credential] = await db.ressource.credential.list( @@ -133,7 +132,7 @@ export const handler: SessionHandlers = { // Save credential to db await db.ressource.credential.set([ - credential.update({ store: passkey }), + credential.update({ store: newPasskey }), ]) // log user