mirror of
https://github.com/Unleash/unleash.git
synced 2024-12-22 19:07:54 +01:00
fix: enterprise routes 404 when not logged in (#8640)
Evaluate `*` with login redirect before showing 404s.
This commit is contained in:
parent
b9df5060ca
commit
e7c2bf0df0
@ -21,6 +21,7 @@ import { InternalBanners } from './banners/internalBanners/InternalBanners';
|
||||
import { ExternalBanners } from './banners/externalBanners/ExternalBanners';
|
||||
import { LicenseBanner } from './banners/internalBanners/LicenseBanner';
|
||||
import { Demo } from './demo/Demo';
|
||||
import { LoginRedirect } from './common/LoginRedirect/LoginRedirect';
|
||||
|
||||
const StyledContainer = styled('div')(() => ({
|
||||
'& ul': {
|
||||
@ -47,6 +48,8 @@ export const App = () => {
|
||||
}
|
||||
}, [authDetails, user]);
|
||||
|
||||
const isLoggedIn = Boolean(user?.id);
|
||||
|
||||
return (
|
||||
<SWRProvider>
|
||||
<Suspense fallback={<Loader type='fullscreen' />}>
|
||||
@ -92,7 +95,13 @@ export const App = () => {
|
||||
/>
|
||||
<Route
|
||||
path='*'
|
||||
element={<NotFound />}
|
||||
element={
|
||||
isLoggedIn ? (
|
||||
<NotFound />
|
||||
) : (
|
||||
<LoginRedirect />
|
||||
)
|
||||
}
|
||||
/>
|
||||
</Routes>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user