Open
Conversation
👷 Deploy request for mern-booking-hotel pending review.Visit the deploys page to approve it
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backend Enhancements
Strict Authentication Rate Limiting: Implemented a dedicated authLimiter in the server entry point to protect sensitive endpoints. This limits each IP address to 10 login or registration attempts every 15 minutes, effectively mitigating brute-force and credential-stuffing attacks.
Centralized Global Error Handling: Added a global error-handling middleware at the end of the application stack. This ensures that any unhandled exceptions are caught and returned to the client as a consistent JSON response containing a status code and message, preventing the leakage of sensitive stack traces in production environments.
Request Optimization: Configured the middleware stack to prioritize security and performance by placing the new rate limiters alongside existing general and payment limiters.
Frontend Enhancements
Global Error Boundary: Introduced a high-level ErrorBoundary component in the React application. This component acts as a safety net that catches JavaScript errors anywhere in the child component tree, preventing the entire application from crashing and showing a blank white screen.
Graceful Fallback UI: Designed a professional fallback interface that displays a clear error message and a "Refresh Page" button when a crash is caught, maintaining a better user experience during unexpected failures.
Robust Component Architecture: Wrapped the primary Router within the new ErrorBoundary in App.tsx, ensuring that routing failures or individual page crashes are handled gracefully across the entire platform.