summary refs log tree commit diff
path: root/src/api/routes/users/@me/mfa
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2025-12-18 01:24:37 +0100
committerRory& <root@rory.gay>2025-12-18 01:24:37 +0100
commite2de706abff59381754ead6887bbe5fd324274fa (patch)
tree55e7fdd506b3f03affe02413bec185e25a413c46 /src/api/routes/users/@me/mfa
parentTry traces again (diff)
downloadserver-ts-e2de706abff59381754ead6887bbe5fd324274fa.tar.xz
Avoid re-fetching user if not requesting extra fields
Diffstat (limited to 'src/api/routes/users/@me/mfa')
-rw-r--r--src/api/routes/users/@me/mfa/codes-verification.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/api/routes/users/@me/mfa/codes-verification.ts b/src/api/routes/users/@me/mfa/codes-verification.ts

index 4cc4c072..94213037 100644 --- a/src/api/routes/users/@me/mfa/codes-verification.ts +++ b/src/api/routes/users/@me/mfa/codes-verification.ts
@@ -46,7 +46,7 @@ router.post( // TODO: We don't have email/etc etc, so can't send a verification code. // Once that's done, this route can verify `key` - // const user = await User.findOneOrFail({ where: { id: req.user_id } }); + // const user = req.user; if ((await User.count({ where: { id: req.user_id } })) === 0) throw DiscordApiErrors.UNKNOWN_USER; let codes: BackupCode[];