feat(security): add global error boundary for defense in depth
- Adds `ErrorBoundary` component to catch unhandled React exceptions - Prevents UI crashes (White Screen of Death) - Ensures stack traces are not leaked to the user (Security Enhancement) - Wraps `App` in `main.tsx` - Adds tests verifying fallback UI and absence of error details in DOM Co-authored-by: ragusa-it <196988693+ragusa-it@users.noreply.github.com>
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
import { StrictMode } from 'react';
|
||||
import { createRoot } from 'react-dom/client';
|
||||
import { App } from './App';
|
||||
import { ErrorBoundary } from './components/layout';
|
||||
|
||||
createRoot(document.getElementById('root')!).render(
|
||||
<StrictMode>
|
||||
<App />
|
||||
<ErrorBoundary>
|
||||
<App />
|
||||
</ErrorBoundary>
|
||||
</StrictMode>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user