itizawa hace 6 años
padre
commit
15797a2d85
Se han modificado 1 ficheros con 10 adiciones y 2 borrados
  1. 10 2
      src/server/routes/apiv3/personal-setting.js

+ 10 - 2
src/server/routes/apiv3/personal-setting.js

@@ -76,6 +76,14 @@ module.exports = (crowi) => {
           return (value === req.body.newPassword);
           return (value === req.body.newPassword);
         }),
         }),
     ],
     ],
+    associateLdap: [
+      body('username').isString().not().isEmpty(),
+      body('password').isString().not().isEmpty(),
+    ],
+    disassociateLdap: [
+      body('providerType').isString().not().isEmpty(),
+      body('accountId').isString().not().isEmpty(),
+    ],
   };
   };
 
 
   /**
   /**
@@ -295,7 +303,7 @@ module.exports = (crowi) => {
   });
   });
 
 
   // TODO swagger
   // TODO swagger
-  router.put('/associate-ldap', loginRequiredStrictly, csrf, async(req, res) => {
+  router.put('/associate-ldap', accessTokenParser, loginRequiredStrictly, csrf, validator.associateLdap, ApiV3FormValidator, async(req, res) => {
     const { passportService } = crowi;
     const { passportService } = crowi;
     const { user, body } = req;
     const { user, body } = req;
     const { username } = body;
     const { username } = body;
@@ -318,7 +326,7 @@ module.exports = (crowi) => {
   });
   });
 
 
   // TODO swagger
   // TODO swagger
-  router.put('/disassociate-ldap', loginRequiredStrictly, csrf, async(req, res) => {
+  router.put('/disassociate-ldap', accessTokenParser, loginRequiredStrictly, csrf, validator.disassociateLdap, ApiV3FormValidator, async(req, res) => {
     const { user, body } = req;
     const { user, body } = req;
     const { providerType, accountId } = body;
     const { providerType, accountId } = body;