From 69818c9394366b954b6ba3bd697bd9d2b09f2a16 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Sat, 10 Jun 2017 22:15:25 +0200 Subject: Type functions --- server/middlewares/oauth.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'server/middlewares/oauth.ts') diff --git a/server/middlewares/oauth.ts b/server/middlewares/oauth.ts index 468e41810..d545b3e58 100644 --- a/server/middlewares/oauth.ts +++ b/server/middlewares/oauth.ts @@ -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) } -- cgit v1.2.3