Преглед изворни кода

Merge branch 'master' into support/use-jotai

Yuki Takei пре 5 месеци
родитељ
комит
5e8499ba3b

+ 0 - 3
apps/app/src/interfaces/crowi-request.ts

@@ -10,9 +10,6 @@ export interface CrowiProperties {
   crowi: Crowi;
   crowi: Crowi;
 
 
   session: any;
   session: any;
-
-  // provided by csurf
-  csrfToken: () => string;
 }
 }
 
 
 export interface CrowiRequest extends CrowiProperties, Request {}
 export interface CrowiRequest extends CrowiProperties, Request {}

+ 0 - 8
apps/app/src/pages/common-props/commons.ts

@@ -85,7 +85,6 @@ export type CommonEachProps = {
   currentPathname: string;
   currentPathname: string;
   nextjsRoutingPage?: string; // must be set by each page
   nextjsRoutingPage?: string; // must be set by each page
   currentUser?: IUserHasId;
   currentUser?: IUserHasId;
-  csrfToken: string;
   isMaintenanceMode: boolean;
   isMaintenanceMode: boolean;
   redirectDestination?: string | null;
   redirectDestination?: string | null;
 };
 };
@@ -127,12 +126,6 @@ function isValidCommonEachRouteProps(
     );
     );
     return false;
     return false;
   }
   }
-  if (typeof p.csrfToken !== 'string') {
-    logger.warn('isValidCommonEachRouteProps: csrfToken is not a string', {
-      csrfToken: p.csrfToken,
-    });
-    return false;
-  }
   if (typeof p.isMaintenanceMode !== 'boolean') {
   if (typeof p.isMaintenanceMode !== 'boolean') {
     logger.warn(
     logger.warn(
       'isValidCommonEachRouteProps: isMaintenanceMode is not a boolean',
       'isValidCommonEachRouteProps: isMaintenanceMode is not a boolean',
@@ -183,7 +176,6 @@ export const getServerSideCommonEachProps = async (
     currentPathname,
     currentPathname,
     nextjsRoutingPage,
     nextjsRoutingPage,
     currentUser,
     currentUser,
-    csrfToken: req.csrfToken(),
     isMaintenanceMode,
     isMaintenanceMode,
     redirectDestination,
     redirectDestination,
   };
   };

+ 0 - 1
apps/app/src/states/global/global.ts

@@ -130,7 +130,6 @@ const forcedColorSchemeAtom = atom<ColorScheme | undefined>(undefined);
 export const useForcedColorScheme = () => useAtomValue(forcedColorSchemeAtom);
 export const useForcedColorScheme = () => useAtomValue(forcedColorSchemeAtom);
 
 
 export const _atomsForHydration = {
 export const _atomsForHydration = {
-  csrfTokenAtom,
   currentPathnameAtom,
   currentPathnameAtom,
   currentUserAtom,
   currentUserAtom,
   appTitleAtom,
   appTitleAtom,

+ 0 - 2
apps/app/src/states/global/hydrate.ts

@@ -7,7 +7,6 @@ import { _atomsForHydration } from './global';
 const {
 const {
   appTitleAtom,
   appTitleAtom,
   confidentialAtom,
   confidentialAtom,
-  csrfTokenAtom,
   currentPathnameAtom,
   currentPathnameAtom,
   currentUserAtom,
   currentUserAtom,
   customTitleTemplateAtom,
   customTitleTemplateAtom,
@@ -66,7 +65,6 @@ export const useHydrateGlobalEachAtoms = (
   // Hydrate global atoms with server-side data
   // Hydrate global atoms with server-side data
   useHydrateAtoms(
   useHydrateAtoms(
     [
     [
-      [csrfTokenAtom, commonEachProps.csrfToken],
       [currentPathnameAtom, commonEachProps.currentPathname],
       [currentPathnameAtom, commonEachProps.currentPathname],
       [currentUserAtom, commonEachProps.currentUser],
       [currentUserAtom, commonEachProps.currentUser],
       [isMaintenanceModeAtom, commonEachProps.isMaintenanceMode],
       [isMaintenanceModeAtom, commonEachProps.isMaintenanceMode],