This commit is contained in:
Adria Navarro 2025-03-17 13:18:23 +01:00
parent 2ab1855c94
commit 9e3e59825e
1 changed files with 3 additions and 3 deletions

View File

@ -6,7 +6,7 @@ import authorized from "../../middleware/authorized"
import * as controller from "../controllers/oauth2"
import Joi from "joi"
function createOAauth2ConfigValidator() {
function oAuth2ConfigValidator() {
return middleware.joiValidator.body(
Joi.object({
name: Joi.string().required(),
@ -14,7 +14,7 @@ function createOAauth2ConfigValidator() {
clientId: Joi.string().required(),
clientSecret: Joi.string().required(),
}),
{ allowUnknown: true }
{ allowUnknown: false }
)
}
@ -24,7 +24,7 @@ router.get("/api/oauth2", authorized(PermissionType.BUILDER), controller.fetch)
router.post(
"/api/oauth2",
authorized(PermissionType.BUILDER),
createOAauth2ConfigValidator(),
oAuth2ConfigValidator(),
controller.create
)
router.put(