0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00

fix(core): fix SSO quota guard (#5065)

This commit is contained in:
Darcy Ye 2023-12-06 13:53:10 +08:00 committed by GitHub
parent 9a7b19e49d
commit fce8d142da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -40,8 +40,6 @@ export default function singleSignOnRoutes<T extends AuthedRouter>(...args: Rout
}, },
] = args; ] = args;
router.use(koaQuotaGuard({ key: 'ssoEnabled', quota, methods: ['POST', 'PUT'] }));
const pathname = `/${tableToPathname(SsoConnectors.table)}`; const pathname = `/${tableToPathname(SsoConnectors.table)}`;
/* /*
@ -68,6 +66,7 @@ export default function singleSignOnRoutes<T extends AuthedRouter>(...args: Rout
/* Create a new single sign on connector */ /* Create a new single sign on connector */
router.post( router.post(
pathname, pathname,
koaQuotaGuard({ key: 'ssoEnabled', quota }),
koaGuard({ koaGuard({
body: ssoConnectorCreateGuard, body: ssoConnectorCreateGuard,
response: SsoConnectors.guard, response: SsoConnectors.guard,