mirror of
https://github.com/strapi/strapi.git
synced 2025-11-03 03:17:11 +00:00
Chore: Remove createRoute utility for auth routes
This commit is contained in:
parent
6601e325f0
commit
dd73efe18d
@ -1,4 +1,4 @@
|
|||||||
export const SET_APP_RUNTIME_STATUS = 'StrapiAdmin/APP/SET_APP_RUNTIME_STATUS';
|
export const SET_APP_RUNTIME_STATUS = 'StrapiAdmin/APP/SET_APP_RUNTIME_STATUS';
|
||||||
export const SET_ADMIN_PERMISSIONS = 'StrapiAdmin/App/SET_ADMIN_PERMISSIONS';
|
export const SET_ADMIN_PERMISSIONS = 'StrapiAdmin/App/SET_ADMIN_PERMISSIONS';
|
||||||
|
|
||||||
export const ROUTES_CE = [];
|
export const AUTH_ROUTES_CE = [];
|
||||||
|
|||||||
@ -1,9 +1,3 @@
|
|||||||
/**
|
|
||||||
*
|
|
||||||
* App.js
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
|
|
||||||
import { SkipToContent } from '@strapi/design-system';
|
import { SkipToContent } from '@strapi/design-system';
|
||||||
@ -24,9 +18,8 @@ import PrivateRoute from '../../components/PrivateRoute';
|
|||||||
import { ADMIN_PERMISSIONS_CE } from '../../constants';
|
import { ADMIN_PERMISSIONS_CE } from '../../constants';
|
||||||
import useConfigurations from '../../hooks/useConfigurations';
|
import useConfigurations from '../../hooks/useConfigurations';
|
||||||
import { useEnterprise } from '../../hooks/useEnterprise';
|
import { useEnterprise } from '../../hooks/useEnterprise';
|
||||||
import { createRoute } from '../../utils/createRoute';
|
|
||||||
|
|
||||||
import { ROUTES_CE, SET_ADMIN_PERMISSIONS } from './constants';
|
import { AUTH_ROUTES_CE, SET_ADMIN_PERMISSIONS } from './constants';
|
||||||
|
|
||||||
const AuthPage = React.lazy(() =>
|
const AuthPage = React.lazy(() =>
|
||||||
import(/* webpackChunkName: "Admin-AuthPage" */ '../AuthPage').then((module) => ({
|
import(/* webpackChunkName: "Admin-AuthPage" */ '../AuthPage').then((module) => ({
|
||||||
@ -77,9 +70,9 @@ export function App() {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
const routes = useEnterprise(
|
const authRoutes = useEnterprise(
|
||||||
ROUTES_CE,
|
AUTH_ROUTES_CE,
|
||||||
async () => (await import('../../../../ee/admin/pages/App/constants')).ROUTES_EE,
|
async () => (await import('../../../../ee/admin/pages/App/constants')).AUTH_ROUTES_EE,
|
||||||
{
|
{
|
||||||
defaultValue: [],
|
defaultValue: [],
|
||||||
}
|
}
|
||||||
@ -201,8 +194,6 @@ export function App() {
|
|||||||
}
|
}
|
||||||
}, [telemetryProperties, uuid]);
|
}, [telemetryProperties, uuid]);
|
||||||
|
|
||||||
const authRoutes = routes.map(({ to, Component, exact }) => createRoute(Component, to, exact));
|
|
||||||
|
|
||||||
const trackingContext = React.useMemo(
|
const trackingContext = React.useMemo(
|
||||||
() => ({
|
() => ({
|
||||||
uuid,
|
uuid,
|
||||||
@ -220,7 +211,10 @@ export function App() {
|
|||||||
<SkipToContent>{formatMessage({ id: 'skipToContent' })}</SkipToContent>
|
<SkipToContent>{formatMessage({ id: 'skipToContent' })}</SkipToContent>
|
||||||
<TrackingProvider value={trackingContext}>
|
<TrackingProvider value={trackingContext}>
|
||||||
<Switch>
|
<Switch>
|
||||||
{authRoutes}
|
{authRoutes.map(({ to, Component, exact }) => (
|
||||||
|
<Route key={to} path={to} component={Component} exact={exact} />
|
||||||
|
))}
|
||||||
|
|
||||||
<Route
|
<Route
|
||||||
path="/auth/:authType"
|
path="/auth/:authType"
|
||||||
render={(routerProps) => (
|
render={(routerProps) => (
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { AuthResponse } from '../AuthResponse';
|
import { AuthResponse } from '../AuthResponse';
|
||||||
|
|
||||||
export const ROUTES_EE = [
|
export const AUTH_ROUTES_EE = [
|
||||||
{
|
{
|
||||||
Component: () => ({ default: AuthResponse }),
|
Component: () => ({ default: AuthResponse }),
|
||||||
to: '/auth/login/:authResponse',
|
to: '/auth/login/:authResponse',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user