From 4687b21d796125de9ded3c2e2d5b955d8cc11ae5 Mon Sep 17 00:00:00 2001 From: TrojanerHD Date: Sat, 24 Feb 2024 02:14:03 +0100 Subject: [PATCH] fix(backend): update security keys available entry --- packages/backend/src/server/api/endpoints/i/2fa/key-done.ts | 2 ++ packages/backend/src/server/api/endpoints/i/2fa/remove-key.ts | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) 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 7c5aa442..0892e524 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 582242b2..3ff4d901 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, }); }