diff options
author | Chocobozzz <me@florianbigard.com> | 2020-01-31 16:56:52 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-02-03 08:31:02 +0100 |
commit | a15871560f80e07386c1dabb8370cd2664ecfd1f (patch) | |
tree | 44440e140c9e43b0d7f97ade777a76e649e0553d /server/middlewares/validators/users.ts | |
parent | a22046d166805222ca76060e471b6cb3d419a32d (diff) | |
download | PeerTube-a15871560f80e07386c1dabb8370cd2664ecfd1f.tar.gz PeerTube-a15871560f80e07386c1dabb8370cd2664ecfd1f.tar.zst PeerTube-a15871560f80e07386c1dabb8370cd2664ecfd1f.zip |
Move to eslintcontain
Diffstat (limited to 'server/middlewares/validators/users.ts')
-rw-r--r-- | server/middlewares/validators/users.ts | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/server/middlewares/validators/users.ts b/server/middlewares/validators/users.ts index c78c67a8c..5d52b5804 100644 --- a/server/middlewares/validators/users.ts +++ b/server/middlewares/validators/users.ts | |||
@@ -36,7 +36,6 @@ import { doesVideoExist } from '../../helpers/middlewares' | |||
36 | import { UserRole } from '../../../shared/models/users' | 36 | import { UserRole } from '../../../shared/models/users' |
37 | import { MUserDefault } from '@server/typings/models' | 37 | import { MUserDefault } from '@server/typings/models' |
38 | import { Hooks } from '@server/lib/plugins/hooks' | 38 | import { Hooks } from '@server/lib/plugins/hooks' |
39 | import { isLocalVideoAccepted } from '@server/lib/moderation' | ||
40 | 39 | ||
41 | const usersAddValidator = [ | 40 | const usersAddValidator = [ |
42 | body('username').custom(isUserUsernameValid).withMessage('Should have a valid username (lowercase alphanumeric characters)'), | 41 | body('username').custom(isUserUsernameValid).withMessage('Should have a valid username (lowercase alphanumeric characters)'), |
@@ -149,7 +148,7 @@ const usersBlockingValidator = [ | |||
149 | ] | 148 | ] |
150 | 149 | ||
151 | const deleteMeValidator = [ | 150 | const deleteMeValidator = [ |
152 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { | 151 | (req: express.Request, res: express.Response, next: express.NextFunction) => { |
153 | const user = res.locals.oauth.token.User | 152 | const user = res.locals.oauth.token.User |
154 | if (user.username === 'root') { | 153 | if (user.username === 'root') { |
155 | return res.status(400) | 154 | return res.status(400) |
@@ -303,7 +302,7 @@ const ensureUserRegistrationAllowed = [ | |||
303 | ] | 302 | ] |
304 | 303 | ||
305 | const ensureUserRegistrationAllowedForIP = [ | 304 | const ensureUserRegistrationAllowedForIP = [ |
306 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { | 305 | (req: express.Request, res: express.Response, next: express.NextFunction) => { |
307 | const allowed = isSignupAllowedForCurrentIP(req.ip) | 306 | const allowed = isSignupAllowedForCurrentIP(req.ip) |
308 | 307 | ||
309 | if (allowed === false) { | 308 | if (allowed === false) { |
@@ -410,7 +409,7 @@ const userAutocompleteValidator = [ | |||
410 | ] | 409 | ] |
411 | 410 | ||
412 | const ensureAuthUserOwnsAccountValidator = [ | 411 | const ensureAuthUserOwnsAccountValidator = [ |
413 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { | 412 | (req: express.Request, res: express.Response, next: express.NextFunction) => { |
414 | const user = res.locals.oauth.token.User | 413 | const user = res.locals.oauth.token.User |
415 | 414 | ||
416 | if (res.locals.account.id !== user.Account.id) { | 415 | if (res.locals.account.id !== user.Account.id) { |