1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 02:39:33 +02:00

Add req and res as controllers hooks parameters

Hooks prefixed by `action:api` now give access the original express req and res.
Checkout guide.md for possible usage.
This commit is contained in:
lutangar 2021-11-24 14:33:14 +01:00 committed by Chocobozzz
parent 5098098d96
commit 7226e90fdc
12 changed files with 41 additions and 23 deletions

View file

@ -66,7 +66,7 @@ async function handleToken (req: express.Request, res: express.Response, next: e
res.set('Cache-Control', 'no-store')
res.set('Pragma', 'no-cache')
Hooks.runAction('action:api.user.oauth2-got-token', { username: token.user.username, ip: req.ip })
Hooks.runAction('action:api.user.oauth2-got-token', { username: token.user.username, ip: req.ip, req, res })
return res.json({
token_type: 'Bearer',