diff options
author | Chocobozzz <me@florianbigard.com> | 2019-04-11 11:33:44 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-04-11 13:45:39 +0200 |
commit | 6dd9de95dfa39bd5c1faed00d1dbd52cd112bae0 (patch) | |
tree | b47de7efb8c6c611c63a15a971c6125a278f547a /server/middlewares/validators/user-subscriptions.ts | |
parent | 2c3abc4fa796555eb7d25f416c4f41ab3e3ad8ca (diff) | |
download | PeerTube-6dd9de95dfa39bd5c1faed00d1dbd52cd112bae0.tar.gz PeerTube-6dd9de95dfa39bd5c1faed00d1dbd52cd112bae0.tar.zst PeerTube-6dd9de95dfa39bd5c1faed00d1dbd52cd112bae0.zip |
Move config in its own file
Diffstat (limited to 'server/middlewares/validators/user-subscriptions.ts')
-rw-r--r-- | server/middlewares/validators/user-subscriptions.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/server/middlewares/validators/user-subscriptions.ts b/server/middlewares/validators/user-subscriptions.ts index fd82ed017..2356745d7 100644 --- a/server/middlewares/validators/user-subscriptions.ts +++ b/server/middlewares/validators/user-subscriptions.ts | |||
@@ -5,8 +5,8 @@ import { logger } from '../../helpers/logger' | |||
5 | import { areValidationErrors } from './utils' | 5 | import { areValidationErrors } from './utils' |
6 | import { ActorFollowModel } from '../../models/activitypub/actor-follow' | 6 | import { ActorFollowModel } from '../../models/activitypub/actor-follow' |
7 | import { areValidActorHandles, isValidActorHandle } from '../../helpers/custom-validators/activitypub/actor' | 7 | import { areValidActorHandles, isValidActorHandle } from '../../helpers/custom-validators/activitypub/actor' |
8 | import { CONFIG } from '../../initializers' | ||
9 | import { toArray } from '../../helpers/custom-validators/misc' | 8 | import { toArray } from '../../helpers/custom-validators/misc' |
9 | import { WEBSERVER } from '../../initializers/constants' | ||
10 | 10 | ||
11 | const userSubscriptionAddValidator = [ | 11 | const userSubscriptionAddValidator = [ |
12 | body('uri').custom(isValidActorHandle).withMessage('Should have a valid URI to follow (username@domain)'), | 12 | body('uri').custom(isValidActorHandle).withMessage('Should have a valid URI to follow (username@domain)'), |
@@ -43,7 +43,7 @@ const userSubscriptionGetValidator = [ | |||
43 | if (areValidationErrors(req, res)) return | 43 | if (areValidationErrors(req, res)) return |
44 | 44 | ||
45 | let [ name, host ] = req.params.uri.split('@') | 45 | let [ name, host ] = req.params.uri.split('@') |
46 | if (host === CONFIG.WEBSERVER.HOST) host = null | 46 | if (host === WEBSERVER.HOST) host = null |
47 | 47 | ||
48 | const user = res.locals.oauth.token.User | 48 | const user = res.locals.oauth.token.User |
49 | const subscription = await ActorFollowModel.loadByActorAndTargetNameAndHostForAPI(user.Account.Actor.id, name, host) | 49 | const subscription = await ActorFollowModel.loadByActorAndTargetNameAndHostForAPI(user.Account.Actor.id, name, host) |