diff --git a/packages/backend/src/server/api/endpoints/i/2fa/key-done.ts b/packages/backend/src/server/api/endpoints/i/2fa/key-done.ts index 7c5aa4428..0892e524f 100644 --- a/packages/backend/src/server/api/endpoints/i/2fa/key-done.ts +++ b/packages/backend/src/server/api/endpoints/i/2fa/key-done.ts @@ -144,6 +144,8 @@ export default define(meta, paramDef, async (ps, user) => { }), ); + UserProfiles.update(user.id, { securityKeysAvailable: true }); + return { id: credentialIdString, name: ps.name, diff --git a/packages/backend/src/server/api/endpoints/i/2fa/remove-key.ts b/packages/backend/src/server/api/endpoints/i/2fa/remove-key.ts index 582242b29..3ff4d9017 100644 --- a/packages/backend/src/server/api/endpoints/i/2fa/remove-key.ts +++ b/packages/backend/src/server/api/endpoints/i/2fa/remove-key.ts @@ -47,8 +47,9 @@ export default define(meta, paramDef, async (ps, user) => { }); if (keyCount === 0) { - await UserProfiles.update(me.id, { + await UserProfiles.update(user.id, { usePasswordLessLogin: false, + securityKeysAvailable: false, }); }