mirror of
https://github.com/logto-io/logto.git
synced 2025-01-20 21:32:31 -05:00
refactor(console): refactor some console global routes (#5841)
This commit is contained in:
parent
266af8c3d7
commit
dc0d5775ae
3 changed files with 8 additions and 5 deletions
|
@ -6,6 +6,7 @@ import AcceptInvitation from '@/pages/AcceptInvitation';
|
|||
import Callback from '@/pages/Callback';
|
||||
import CheckoutSuccessCallback from '@/pages/CheckoutSuccessCallback';
|
||||
import Profile from '@/pages/Profile';
|
||||
import HandleSocialCallback from '@/pages/Profile/containers/HandleSocialCallback';
|
||||
|
||||
import * as styles from './AppRoutes.module.scss';
|
||||
import Main from './pages/Main';
|
||||
|
@ -20,10 +21,11 @@ function AppRoutes() {
|
|||
<Route path={GlobalAnonymousRoute.SocialDemoCallback} element={<SocialDemoCallback />} />
|
||||
<Route element={<ProtectedRoutes />}>
|
||||
<Route
|
||||
path={`${GlobalRoute.AcceptInvitation}/:invitationId`}
|
||||
path={`${GlobalAnonymousRoute.AcceptInvitation}/:invitationId`}
|
||||
element={<AcceptInvitation />}
|
||||
/>
|
||||
<Route path={GlobalAnonymousRoute.Profile + '/*'} element={<Profile />} />
|
||||
<Route path="/handle-social" element={<HandleSocialCallback />} />
|
||||
<Route path={GlobalRoute.CheckoutSuccessCallback} element={<CheckoutSuccessCallback />} />
|
||||
<Route index element={<Main />} />
|
||||
</Route>
|
||||
|
|
|
@ -40,13 +40,14 @@ export function ConsoleRoutes() {
|
|||
* console path to trigger the console routes.
|
||||
*/}
|
||||
{!isCloud && <Route path="/" element={<Navigate to={ossConsolePath} />} />}
|
||||
{!isCloud && (
|
||||
<Route path={ossConsolePath + GlobalAnonymousRoute.Profile + '/*'} element={<Profile />} />
|
||||
)}
|
||||
<Route path="/:tenantId" element={<Layout />}>
|
||||
<Route path="callback" element={<Callback />} />
|
||||
<Route path="welcome" element={<Welcome />} />
|
||||
<Route element={<ProtectedRoutes />}>
|
||||
<Route
|
||||
path={dropLeadingSlash(GlobalAnonymousRoute.Profile) + '/*'}
|
||||
element={<Profile />}
|
||||
/>
|
||||
<Route path="handle-social" element={<HandleSocialCallback />} />
|
||||
<Route element={<TenantAccess />}>
|
||||
{isCloud && (
|
||||
|
|
|
@ -21,6 +21,7 @@ import { isCloud } from '@/consts/env';
|
|||
export enum GlobalAnonymousRoute {
|
||||
Callback = '/callback',
|
||||
SocialDemoCallback = '/social-demo-callback',
|
||||
AcceptInvitation = '/accept',
|
||||
Profile = '/profile',
|
||||
}
|
||||
|
||||
|
@ -29,7 +30,6 @@ export enum GlobalAnonymousRoute {
|
|||
*/
|
||||
export enum GlobalRoute {
|
||||
CheckoutSuccessCallback = '/checkout-success-callback',
|
||||
AcceptInvitation = '/accept',
|
||||
}
|
||||
|
||||
const reservedRoutes: Readonly<string[]> = Object.freeze([
|
||||
|
|
Loading…
Add table
Reference in a new issue