aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/users/token.ts
diff options
context:
space:
mode:
authorlutangar <johan.dufour@gmail.com>2021-11-24 14:33:14 +0100
committerChocobozzz <chocobozzz@cpy.re>2021-11-25 09:54:22 +0100
commit7226e90fdc61a3c6cad5ccab18b6707d55cf0992 (patch)
tree0bdd7304352b1af2d9ae87439486a138e02d46e8 /server/controllers/api/users/token.ts
parent5098098d96164c93f84ec8419e98fbd83ba8dc71 (diff)
downloadPeerTube-7226e90fdc61a3c6cad5ccab18b6707d55cf0992.tar.gz
PeerTube-7226e90fdc61a3c6cad5ccab18b6707d55cf0992.tar.zst
PeerTube-7226e90fdc61a3c6cad5ccab18b6707d55cf0992.zip
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.
Diffstat (limited to 'server/controllers/api/users/token.ts')
-rw-r--r--server/controllers/api/users/token.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/server/controllers/api/users/token.ts b/server/controllers/api/users/token.ts
index d5dbe921c..1d4004ce0 100644
--- a/server/controllers/api/users/token.ts
+++ b/server/controllers/api/users/token.ts
@@ -66,7 +66,7 @@ async function handleToken (req: express.Request, res: express.Response, next: e
66 res.set('Cache-Control', 'no-store') 66 res.set('Cache-Control', 'no-store')
67 res.set('Pragma', 'no-cache') 67 res.set('Pragma', 'no-cache')
68 68
69 Hooks.runAction('action:api.user.oauth2-got-token', { username: token.user.username, ip: req.ip }) 69 Hooks.runAction('action:api.user.oauth2-got-token', { username: token.user.username, ip: req.ip, req, res })
70 70
71 return res.json({ 71 return res.json({
72 token_type: 'Bearer', 72 token_type: 'Bearer',