From 6d8dbbb617724910ccbffab10f4f2b7a84d70836 Mon Sep 17 00:00:00 2001 From: Andrea Vos Date: Tue, 31 Dec 2024 11:35:12 +0100 Subject: [PATCH] fix types --- server/express/user.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/server/express/user.ts b/server/express/user.ts index 388b3a7ed..e61047af3 100644 --- a/server/express/user.ts +++ b/server/express/user.ts @@ -106,7 +106,7 @@ export const saveAuthenticator = async ( payload, }); } - await auditLog({ db, user }, 'auth/saved_authenticator', { + await auditLog({ user }, 'auth/saved_authenticator', { type, payloadId: payload.id || undefined, name: payload.name || undefined, @@ -478,7 +478,7 @@ router.post('/user/init', handleErrorAsync(async (req, res) => { if (user) { const { block } = await fetchLoginAttempts(req.db, user.id); if (block) { - await auditLog({ db: req.db, user }, 'auth/login_too_many_attempts'); + await auditLog({ user }, 'auth/login_too_many_attempts'); return res.json({ error: 'user.tooManyAttempts' }); } } @@ -490,12 +490,12 @@ router.post('/user/init', handleErrorAsync(async (req, res) => { }; if (!await validateEmail(payload.email)) { - await auditLog({ db: req.db, user }, 'auth/email_invalid', { email: payload.email }); + await auditLog({ user }, 'auth/email_invalid', { email: payload.email }); return res.json({ error: 'user.account.changeEmail.invalid' }); } if (!user && await lookupBanArchive(req.db, 'email', payload)) { - await auditLog({ db: req.db, user }, 'auth/blocked_archive_ban'); + await auditLog({ user }, 'auth/blocked_archive_ban'); return res.status(401).json({ error: 'Unauthorised' }); } @@ -511,12 +511,12 @@ router.post('/user/init', handleErrorAsync(async (req, res) => { mailer(payload.email, 'confirmCode', { code: payload.code }); - await auditLog({ db: req.db, user }, 'auth/requested_email_code', { email: payload.email }); + await auditLog({ user }, 'auth/requested_email_code', { email: payload.email }); }, async () => { const auth = await findLatestEmailAuthenticator(req.db, payload.email, 'email'); codeKey = auth ? auth.id : null; - await auditLog({ db: req.db, user }, 'auth/requested_email_code_duplicate', { email: payload.email }); + await auditLog({ user }, 'auth/requested_email_code_duplicate', { email: payload.email }); }, ); }