diff options
author | Chocobozzz <me@florianbigard.com> | 2021-01-04 09:54:48 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-01-04 09:54:48 +0100 |
commit | 2dbc170da35c9f88770653cd3114f4c59d482094 (patch) | |
tree | 0befce119e2fe3a750b000cb8b971d12e41550a3 /server/controllers/api/users/index.ts | |
parent | afd4ee86ddb97f8d49585fddd318bedcd3ad55b8 (diff) | |
download | PeerTube-2dbc170da35c9f88770653cd3114f4c59d482094.tar.gz PeerTube-2dbc170da35c9f88770653cd3114f4c59d482094.tar.zst PeerTube-2dbc170da35c9f88770653cd3114f4c59d482094.zip |
Add missing audit log if the user deletes its account
Diffstat (limited to 'server/controllers/api/users/index.ts')
-rw-r--r-- | server/controllers/api/users/index.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/server/controllers/api/users/index.ts b/server/controllers/api/users/index.ts index d743a9912..c3190e731 100644 --- a/server/controllers/api/users/index.ts +++ b/server/controllers/api/users/index.ts | |||
@@ -305,10 +305,10 @@ async function listUsers (req: express.Request, res: express.Response) { | |||
305 | async function removeUser (req: express.Request, res: express.Response) { | 305 | async function removeUser (req: express.Request, res: express.Response) { |
306 | const user = res.locals.user | 306 | const user = res.locals.user |
307 | 307 | ||
308 | await user.destroy() | ||
309 | |||
310 | auditLogger.delete(getAuditIdFromRes(res), new UserAuditView(user.toFormattedJSON())) | 308 | auditLogger.delete(getAuditIdFromRes(res), new UserAuditView(user.toFormattedJSON())) |
311 | 309 | ||
310 | await user.destroy() | ||
311 | |||
312 | Hooks.runAction('action:api.user.deleted', { user }) | 312 | Hooks.runAction('action:api.user.deleted', { user }) |
313 | 313 | ||
314 | return res.sendStatus(HttpStatusCode.NO_CONTENT_204) | 314 | return res.sendStatus(HttpStatusCode.NO_CONTENT_204) |