aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/oauth-clients.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers/api/oauth-clients.ts')
-rw-r--r--server/controllers/api/oauth-clients.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/server/controllers/api/oauth-clients.ts b/server/controllers/api/oauth-clients.ts
index b2de8bcf5..c21e2298d 100644
--- a/server/controllers/api/oauth-clients.ts
+++ b/server/controllers/api/oauth-clients.ts
@@ -1,5 +1,6 @@
1import * as express from 'express' 1import * as express from 'express'
2import { OAuthClientLocal } from '../../../shared' 2import { OAuthClientLocal } from '../../../shared'
3import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes'
3import { logger } from '../../helpers/logger' 4import { logger } from '../../helpers/logger'
4import { CONFIG } from '../../initializers/config' 5import { CONFIG } from '../../initializers/config'
5import { asyncMiddleware } from '../../middlewares' 6import { asyncMiddleware } from '../../middlewares'
@@ -23,7 +24,7 @@ async function getLocalClient (req: express.Request, res: express.Response, next
23 // Don't make this check if this is a test instance 24 // Don't make this check if this is a test instance
24 if (process.env.NODE_ENV !== 'test' && req.get('host') !== headerHostShouldBe) { 25 if (process.env.NODE_ENV !== 'test' && req.get('host') !== headerHostShouldBe) {
25 logger.info('Getting client tokens for host %s is forbidden (expected %s).', req.get('host'), headerHostShouldBe) 26 logger.info('Getting client tokens for host %s is forbidden (expected %s).', req.get('host'), headerHostShouldBe)
26 return res.type('json').status(403).end() 27 return res.type('json').status(HttpStatusCode.FORBIDDEN_403).end()
27 } 28 }
28 29
29 const client = await OAuthClientModel.loadFirstClient() 30 const client = await OAuthClientModel.loadFirstClient()