auditLog for impersonation

This commit is contained in:
Andrea Vos 2024-02-19 18:54:23 +00:00
parent 693e9b5ef1
commit bf0386024a

View File

@ -760,6 +760,8 @@ router.get('/admin/impersonate/:email', handleErrorAsync(async (req, res) => {
email = (await req.db.get(SQL`SELECT email FROM users WHERE usernameNorm = ${normalise(email)}`)).email;
}
await auditLog(req, 'auth/impersonated', { email });
return res.json({ token: await issueAuthentication(req.db, { email }) });
}));