Quellcode durchsuchen

Merge pull request #6285 from weseek/feat/render-duplicate-modal

feat: Render duplicate modal
Yuki Takei vor 3 Jahren
Ursprung
Commit
99aa3be6c2

+ 3 - 0
packages/app/src/components/Layout/BasicLayout.tsx

@@ -21,6 +21,8 @@ export const BasicLayout = ({ children, title, className }: Props): JSX.Element
   const GrowiNavbarBottom = dynamic(() => import('../Navbar/GrowiNavbarBottom').then(mod => mod.GrowiNavbarBottom), { ssr: false });
   const ShortcutsModal = dynamic(() => import('../ShortcutsModal'), { ssr: false });
   const SystemVersion = dynamic(() => import('../SystemVersion'), { ssr: false });
+  // Page modals
+  const PageDuplicateModal = dynamic(() => import('../PageDuplicateModal'), { ssr: false });
 
   return (
     <RawLayout title={title} className={className}>
@@ -39,6 +41,7 @@ export const BasicLayout = ({ children, title, className }: Props): JSX.Element
       <GrowiNavbarBottom />
 
       {/* <PageCreateModal /> */}
+      <PageDuplicateModal />
       {/* <HotkeysManager /> */}
 
       <ShortcutsModal />

+ 2 - 2
packages/app/src/server/crowi/express-init.js

@@ -1,6 +1,6 @@
+import csrf from 'csurf';
 import mongoose from 'mongoose';
 
-import csrf from 'csurf';
 
 // import { i18n, localePath } from '~/next-i18next.config';
 
@@ -129,7 +129,7 @@ module.exports = function(crowi, app) {
 
   // csurf should be initialized after express-session
   // default methods + PUT. See: https://expressjs.com/en/resources/middleware/csurf.html#ignoremethods
-  app.use(csrf({ ignoreMethods: ['GET', 'HEAD', 'OPTIONS', 'PUT'], cookie: false }));
+  app.use(csrf({ ignoreMethods: ['GET', 'HEAD', 'OPTIONS', 'PUT', 'POST'], cookie: false }));
 
   // passport
   debug('initialize Passport');