]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/middlewares/oauth.ts
Video search -> case insensitive
[github/Chocobozzz/PeerTube.git] / server / middlewares / oauth.ts
index 468e418106c69c84ceb596b705665ebadfd7de40..d545b3e58f55f4ff150a2078e400646b520346f3 100644 (file)
@@ -1,3 +1,5 @@
+import 'express-validator'
+import * as express from 'express'
 import * as OAuthServer from 'express-oauth-server'
 
 import { OAUTH_LIFETIME } from '../initializers'
@@ -9,7 +11,7 @@ const oAuthServer = new OAuthServer({
   model: require('../lib/oauth-model')
 })
 
-function authenticate (req, res, next) {
+function authenticate (req: express.Request, res: express.Response, next: express.NextFunction) {
   oAuthServer.authenticate()(req, res, function (err) {
     if (err) {
       logger.error('Cannot authenticate.', { error: err })
@@ -22,7 +24,7 @@ function authenticate (req, res, next) {
   })
 }
 
-function token (req, res, next) {
+function token (req: express.Request, res: express.Response, next: express.NextFunction) {
   return oAuthServer.token()(req, res, next)
 }