From 59d46662ddb7917db6b8110b1336b0a0962a6ec0 Mon Sep 17 00:00:00 2001 From: Andrea Vos Date: Fri, 14 Jun 2024 20:54:26 +0200 Subject: [PATCH] (bugfix) object passed to invalidateAuthenticator instead of its id --- server/routes/user.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/routes/user.js b/server/routes/user.js index b50819856..0e01f481c 100644 --- a/server/routes/user.js +++ b/server/routes/user.js @@ -468,7 +468,7 @@ router.post('/user/validate', handleErrorAsync(async (req, res) => { return res.json({ error: 'user.code.invalid' }); } - await invalidateAuthenticator(req.db, authenticator); + await invalidateAuthenticator(req.db, authenticator.id); await auditLog(req, 'auth/validate_code_valid'); @@ -549,7 +549,7 @@ router.post('/user/change-email', handleErrorAsync(async (req, res) => { return res.json({ error: 'user.code.invalid' }); } - await invalidateAuthenticator(req.db, authenticator); + await invalidateAuthenticator(req.db, authenticator.id); await req.db.get(SQL`UPDATE users SET email = ${authenticator.payload.to} WHERE id = ${req.user.id}`); req.user.email = authenticator.payload.to;