aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/oauth.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/middlewares/oauth.ts')
-rw-r--r--server/middlewares/oauth.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/server/middlewares/oauth.ts b/server/middlewares/oauth.ts
index 1d193d467..2b4e300e4 100644
--- a/server/middlewares/oauth.ts
+++ b/server/middlewares/oauth.ts
@@ -1,7 +1,7 @@
1import * as express from 'express' 1import * as express from 'express'
2import * as OAuthServer from 'express-oauth-server' 2import * as OAuthServer from 'express-oauth-server'
3import 'express-validator' 3import 'express-validator'
4import { OAUTH_LIFETIME } from '../initializers' 4import { OAUTH_LIFETIME } from '../initializers/constants'
5import { logger } from '../helpers/logger' 5import { logger } from '../helpers/logger'
6import { Socket } from 'socket.io' 6import { Socket } from 'socket.io'
7import { getAccessToken } from '../lib/oauth-model' 7import { getAccessToken } from '../lib/oauth-model'
@@ -35,6 +35,8 @@ function authenticateSocket (socket: Socket, next: (err?: any) => void) {
35 35
36 logger.debug('Checking socket access token %s.', accessToken) 36 logger.debug('Checking socket access token %s.', accessToken)
37 37
38 if (!accessToken) return next(new Error('No access token provided'))
39
38 getAccessToken(accessToken) 40 getAccessToken(accessToken)
39 .then(tokenDB => { 41 .then(tokenDB => {
40 const now = new Date() 42 const now = new Date()