(bugfix) object passed to invalidateAuthenticator instead of its id

This commit is contained in:
Andrea Vos 2024-06-14 20:54:26 +02:00
parent 976e6f1851
commit 59d46662dd

View File

@ -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;