-import * as express from 'express'
-import { OAuthClientLocal } from '../../../shared'
-import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes'
+import express from 'express'
+import { isTestOrDevInstance } from '@server/helpers/core-utils'
+import { OAuthClientModel } from '@server/models/oauth/oauth-client'
+import { HttpStatusCode, OAuthClientLocal } from '@shared/models'
import { logger } from '../../helpers/logger'
import { CONFIG } from '../../initializers/config'
import { asyncMiddleware, openapiOperationDoc } from '../../middlewares'
-import { OAuthClientModel } from '../../models/oauth/oauth-client'
const oauthClientsRouter = express.Router()
}
// Don't make this check if this is a test instance
- if (process.env.NODE_ENV !== 'test' && req.get('host') !== headerHostShouldBe) {
+ if (!isTestOrDevInstance() && req.get('host') !== headerHostShouldBe) {
logger.info('Getting client tokens for host %s is forbidden (expected %s).', req.get('host'), headerHostShouldBe)
return res.fail({
status: HttpStatusCode.FORBIDDEN_403,