aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators/user-subscriptions.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/middlewares/validators/user-subscriptions.ts')
-rw-r--r--server/middlewares/validators/user-subscriptions.ts4
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'
5import { areValidationErrors } from './utils' 5import { areValidationErrors } from './utils'
6import { ActorFollowModel } from '../../models/activitypub/actor-follow' 6import { ActorFollowModel } from '../../models/activitypub/actor-follow'
7import { areValidActorHandles, isValidActorHandle } from '../../helpers/custom-validators/activitypub/actor' 7import { areValidActorHandles, isValidActorHandle } from '../../helpers/custom-validators/activitypub/actor'
8import { CONFIG } from '../../initializers'
9import { toArray } from '../../helpers/custom-validators/misc' 8import { toArray } from '../../helpers/custom-validators/misc'
9import { WEBSERVER } from '../../initializers/constants'
10 10
11const userSubscriptionAddValidator = [ 11const 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)