Skip to content

Phase 5 frontend - #7

Merged
Aditya2550 merged 3 commits into
mainfrom
phase-5-frontend
Aug 7, 2026
Merged

Aditya2550 merged 3 commits into
mainfrom
phase-5-frontend

Conversation

@Aditya2550

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI lite review requested due to automatic review settings August 7, 2026 18:20
@Aditya2550
Aditya2550 merged commit c3b6942 into main Aug 7, 2026
1 check passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the frontend auth and routing layer by adding a server-backed logout call and expanding access to the approvals queue for additional roles.

Changes:

  • Added POST /auth/logout API wrapper and wired AuthContext.logout() to call it before client-side cleanup.
  • Expanded ProtectedRoute role access for the approvals queue routes to include finance and director.
  • Cleaned up/standardized router route declarations for /dashboard and /expenses.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
frontend/src/context/AuthContext.jsx Updates logout flow to attempt a backend logout request before clearing local auth state and redirecting.
frontend/src/app/router.jsx Expands allowed roles for approvals-related routes and tidies route declarations.
frontend/src/api/authService.js Adds a logout() API function and normalizes formatting of existing auth API calls.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 48 to 52
path="/manager"
element={
<ProtectedRoute allowedRoles={["manager", "admin"]}>
<ProtectedRoute allowedRoles={["manager", "finance", "director", "admin"]}>
<ApprovalQueuePage />
</ProtectedRoute>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants