Skip to content

Implement authentication context, protected routes, and related features#24

Merged
devcavin merged 4 commits into
mainfrom
client
Jul 11, 2026
Merged

Implement authentication context, protected routes, and related features#24
devcavin merged 4 commits into
mainfrom
client

Conversation

@devcavin

Copy link
Copy Markdown
Owner

This pull request introduces authentication support to the frontend by adding the axios HTTP 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:

  • Added axios as a project dependency in both package.json and package-lock.json to enable HTTP requests from the frontend. [1] [2]
  • Created a new authApi module in frontend/src/api/auth.ts with methods for login, refresh, and logout, including TypeScript interfaces for request and response types.

Routing and page integration:

  • Added a /login route to the application in App.tsx, connecting it to the new Login page component.

Dependency and package management:

  • Updated package-lock.json to include axios and its dependencies, such as follow-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.

devcavin added 2 commits July 10, 2026 23:23
- 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.
@devcavin devcavin added enhancement New feature or request frontend labels Jul 11, 2026
@vercel

vercel Bot commented Jul 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
gatelog Ready Ready Preview, Comment Jul 11, 2026 9:08pm

@devcavin
devcavin merged commit 6895494 into main Jul 11, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request frontend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant