refactor: rewrite create-app-auth-client mutation as REST endpoint

This commit is contained in:
Ali BARIN
2024-08-23 13:51:31 +00:00
parent 164d31dfbc
commit 81c39d7d93
14 changed files with 168 additions and 63 deletions

View File

@@ -5,6 +5,7 @@ import { authorizeAdmin } from '../../../../helpers/authorization.js';
import { checkIsEnterprise } from '../../../../helpers/check-is-enterprise.js';
import getAuthClientsAction from '../../../../controllers/api/v1/admin/apps/get-auth-clients.ee.js';
import getAuthClientAction from '../../../../controllers/api/v1/admin/apps/get-auth-client.ee.js';
import createAuthClientAction from '../../../../controllers/api/v1/admin/apps/create-auth-client.ee.js';
const router = Router();
@@ -16,6 +17,14 @@ router.get(
asyncHandler(getAuthClientsAction)
);
router.post(
'/:appKey/auth-clients',
authenticateUser,
authorizeAdmin,
checkIsEnterprise,
asyncHandler(createAuthClientAction)
);
router.get(
'/:appKey/auth-clients/:appAuthClientId',
authenticateUser,