From 3acc50844047a37698f0618fa235c138e386a053 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 23 Apr 2019 09:50:57 +0200 Subject: Upgrade sequelize --- server/middlewares/oauth.ts | 2 ++ server/middlewares/validators/videos/videos.ts | 1 + 2 files changed, 3 insertions(+) (limited to 'server/middlewares') diff --git a/server/middlewares/oauth.ts b/server/middlewares/oauth.ts index de736e593..2b4e300e4 100644 --- a/server/middlewares/oauth.ts +++ b/server/middlewares/oauth.ts @@ -35,6 +35,8 @@ function authenticateSocket (socket: Socket, next: (err?: any) => void) { logger.debug('Checking socket access token %s.', accessToken) + if (!accessToken) return next(new Error('No access token provided')) + getAccessToken(accessToken) .then(tokenDB => { const now = new Date() diff --git a/server/middlewares/validators/videos/videos.ts b/server/middlewares/validators/videos/videos.ts index e9b036a02..2b01f108d 100644 --- a/server/middlewares/validators/videos/videos.ts +++ b/server/middlewares/validators/videos/videos.ts @@ -68,6 +68,7 @@ const videosAddValidator = getCommonVideoEditAttributes().concat([ if (!await doesVideoChannelOfAccountExist(req.body.channelId, user, res)) return cleanUpReqFiles(req) const isAble = await user.isAbleToUploadVideo(videoFile) + if (isAble === false) { res.status(403) .json({ error: 'The user video quota is exceeded with this video.' }) -- cgit v1.2.3