ソースを参照

Allow attachmentType to allow brand logo attachments on shared pages

Shun Miyazawa 3 年 前
コミット
a4c609cc55

+ 8 - 0
packages/app/src/server/middlewares/certify-shared-file.js

@@ -1,5 +1,7 @@
+import { AttachmentType } from '~/server/interfaces/attachment';
 import loggerFactory from '~/utils/logger';
 
+
 const url = require('url');
 
 const logger = loggerFactory('growi:middleware:certify-shared-fire');
@@ -32,6 +34,12 @@ module.exports = (crowi) => {
       return next();
     }
 
+    const isBlandLogo = attachment.attachmentType === AttachmentType.BRAND_LOGO;
+    if (isBlandLogo) {
+      req.isSharedPage = true;
+      return next();
+    }
+
     const shareLinks = await ShareLink.find({ relatedPage: attachment.page });
 
     // If sharelinks don't exist, skip it