diff options
Diffstat (limited to 'server/controllers/api/oauth-clients.ts')
-rw-r--r-- | server/controllers/api/oauth-clients.ts | 3 |
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 @@ | |||
1 | import * as express from 'express' | 1 | import * as express from 'express' |
2 | import { OAuthClientLocal } from '../../../shared' | 2 | import { OAuthClientLocal } from '../../../shared' |
3 | import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes' | ||
3 | import { logger } from '../../helpers/logger' | 4 | import { logger } from '../../helpers/logger' |
4 | import { CONFIG } from '../../initializers/config' | 5 | import { CONFIG } from '../../initializers/config' |
5 | import { asyncMiddleware } from '../../middlewares' | 6 | import { 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() |