]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/controllers/api/users/token.ts
Merge branch 'release/4.0.0' into develop
[github/Chocobozzz/PeerTube.git] / server / controllers / api / users / token.ts
index b405ddbf41f586e4a1a47d6b861a2768ffb243cd..1d4004ce02db4554fa8b8c73215017ccb50095b9 100644 (file)
@@ -1,5 +1,5 @@
-import * as express from 'express'
-import * as RateLimit from 'express-rate-limit'
+import express from 'express'
+import RateLimit from 'express-rate-limit'
 import { logger } from '@server/helpers/logger'
 import { buildUUID } from '@server/helpers/uuid'
 import { CONFIG } from '@server/initializers/config'
@@ -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',