Conversation
- Added AuthContext for managing authentication state and user roles. - Created ProtectedRoute component to handle route protection based on user roles. - Implemented JWT utility functions for parsing and validating tokens. - Introduced tokenStorage for managing access and refresh tokens in local storage. - Updated Navbar to include Sign In button and improved mobile menu. - Developed Login page with form handling and error management. - Created Unauthorized page for access denial scenarios. - Set up router with role-based redirection and lazy loading for pages. - Added placeholder pages for Dashboard, Reports, Users, Admin, Sites, New Visitor, Visitor List. - Implemented NotFound page for handling 404 errors.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
This pull request introduces authentication support to the frontend by adding the
axiosHTTP client, creating a new authentication API module, and wiring up a basic login route. The main changes include dependency updates, new API logic, and routing for the login page.Authentication support and API integration:
axiosas a project dependency in bothpackage.jsonandpackage-lock.jsonto enable HTTP requests from the frontend. [1] [2]authApimodule infrontend/src/api/auth.tswith methods for login, refresh, and logout, including TypeScript interfaces for request and response types.Routing and page integration:
/loginroute to the application inApp.tsx, connecting it to the newLoginpage component.Dependency and package management:
package-lock.jsonto includeaxiosand its dependencies, such asfollow-redirects,form-data,https-proxy-agent, and others, ensuring proper package resolution and reproducible builds. [1] [2] [3] [4] [5] and others)These changes lay the groundwork for user authentication in the frontend application.