From 7ceaa9c090e89984aae619d92305fbb7626c9726 Mon Sep 17 00:00:00 2001 From: TrojanerHD Date: Sat, 24 Feb 2024 02:13:03 +0100 Subject: [PATCH] feat(backend): remove 2fa requirement for security keys --- packages/backend/src/server/api/endpoints/i/2fa/key-done.ts | 4 ---- .../backend/src/server/api/endpoints/i/2fa/register-key.ts | 4 ---- 2 files changed, 8 deletions(-) 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 5031a88e..7c5aa442 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 @@ -47,10 +47,6 @@ export default define(meta, paramDef, async (ps, user) => { throw new Error("incorrect password"); } - if (!profile.twoFactorEnabled) { - throw new Error("2fa not enabled"); - } - const clientData = JSON.parse(ps.clientDataJSON); if (clientData.type !== "webauthn.create") { diff --git a/packages/backend/src/server/api/endpoints/i/2fa/register-key.ts b/packages/backend/src/server/api/endpoints/i/2fa/register-key.ts index b366c4ab..7115ad16 100644 --- a/packages/backend/src/server/api/endpoints/i/2fa/register-key.ts +++ b/packages/backend/src/server/api/endpoints/i/2fa/register-key.ts @@ -32,10 +32,6 @@ export default define(meta, paramDef, async (ps, user) => { throw new Error("incorrect password"); } - // if (!profile.twoFactorEnabled) { - // throw new Error("2fa not enabled"); - // } - // 32 byte challenge const entropy = await randomBytes(32); const challenge = entropy