Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions apps/webpanel/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@ import AppLayout from './components/sidebar';
import { useAuth } from './hooks/use-auth';
import { routes } from './pages';
import NotFound from './pages/NotFound';
import BackdoorPage from './pages/settings/backdoor';
import { useState } from 'react';

export function App() {
const { user } = useAuth();
const [bd] = useState(() => localStorage.getItem('easter_egg') === '1');

const layoutRoutes = routes.filter(
(r) => r.layout !== false && r.auth !== false,
Expand Down Expand Up @@ -48,13 +51,16 @@ export function App() {
/>
);
})}
<Route
path="*"
element={<ProtectedRoute element={NotFound} auth={false} />}
/>
</Route>
)}

{bd && (
<Route
path="/backdoor"
element={<ProtectedRoute element={BackdoorPage} auth={true} />}
/>
)}

<Route
path="*"
element={<ProtectedRoute element={NotFound} auth={false} />}
Expand Down
1 change: 1 addition & 0 deletions apps/webpanel/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { Toaster } from 'sonner';
declare global {
interface Window {
__SETUP_REQUIRED__?: boolean;
__BACKDOOR_ENABLED__?: boolean;
}
}

Expand Down
Loading
Loading