瀏覽代碼

Remove csrf

https://youtrack.weseek.co.jp/issue/GW-7759
- Remove csrf option from customize-setting route
- Remove unused constant of isDefaultLogo
Mudana-Grune 3 年之前
父節點
當前提交
15614f1373
共有 1 個文件被更改,包括 3 次插入4 次删除
  1. 3 4
      packages/app/src/server/routes/apiv3/customize-setting.js

+ 3 - 4
packages/app/src/server/routes/apiv3/customize-setting.js

@@ -687,7 +687,7 @@ module.exports = (crowi) => {
     return res.apiv3({ isDefaultLogo, customizedLogoSrc });
   });
 
-  router.put('/customize-logo', loginRequiredStrictly, adminRequired, csrf, validator.logo, apiV3FormValidator, async(req, res) => {
+  router.put('/customize-logo', loginRequiredStrictly, adminRequired, validator.logo, apiV3FormValidator, async(req, res) => {
 
     const {
       isDefaultLogo, customizedLogoSrc,
@@ -713,7 +713,7 @@ module.exports = (crowi) => {
   });
 
   router.post('/upload-brand-logo', uploads.single('file'), loginRequiredStrictly,
-    adminRequired, csrf, validator.logo, apiV3FormValidator, async(req, res) => {
+    adminRequired, validator.logo, apiV3FormValidator, async(req, res) => {
 
       if (req.file == null) {
         return res.apiv3Err(new ErrorV3('File error.', 'upload-brand-logo-failed'));
@@ -740,7 +740,6 @@ module.exports = (crowi) => {
       let attachment;
       try {
         attachment = await attachmentService.createAttachment(file, req.user, null, AttachmentType.BRAND_LOGO);
-        const isDefaultLogo = await crowi.configManager.getConfig('crowi', 'customize:isDefaultLogo');
         const attachmentConfigParams = {
           'customize:customizedLogoSrc': attachment.filePathProxied,
         };
@@ -756,7 +755,7 @@ module.exports = (crowi) => {
     });
 
   router.delete('/delete-brand-logo', loginRequiredStrictly,
-    adminRequired, csrf, async(req, res) => {
+    adminRequired, async(req, res) => {
 
       const attachments = await Attachment.find({ attachmentType: AttachmentType.BRAND_LOGO });