0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-02-17 22:04:19 -05:00

refactor(core): disable org apis for non-dev envs (#4813)

This commit is contained in:
Gao Sun 2023-11-03 12:32:12 +08:00 committed by GitHub
parent fab18172c2
commit 6673996288
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -9,6 +9,7 @@ import { type Optional, cond, yes } from '@silverhand/essentials';
import { z } from 'zod';
import { type SearchOptions } from '#src/database/utils.js';
import { EnvSet } from '#src/env-set/index.js';
import RequestError from '#src/errors/RequestError/index.js';
import koaGuard from '#src/middleware/koa-guard.js';
import koaPagination from '#src/middleware/koa-pagination.js';
@ -23,6 +24,11 @@ import organizationScopeRoutes from './scopes.js';
import { errorHandler } from './utils.js';
export default function organizationRoutes<T extends AuthedRouter>(...args: RouterInitArgs<T>) {
// Remove after the feature is ready
if (!EnvSet.values.isDevFeaturesEnabled) {
return;
}
const [
originalRouter,
{