Skip to content

#157 Protect /projects and /platforms routes with auth guard#302

Merged
Eniola3321 merged 1 commit intoANYTECHS:mainfrom
Tobiloba0:main
Apr 29, 2026
Merged

#157 Protect /projects and /platforms routes with auth guard#302
Eniola3321 merged 1 commit intoANYTECHS:mainfrom
Tobiloba0:main

Conversation

@Tobiloba0
Copy link
Copy Markdown
Contributor

This PR fixes an access control issue where the /projects and /platforms pages were not protected by the authentication guard.

Previously, unauthenticated users could access these routes directly via URL. This update ensures they are properly restricted.

✨ Changes
Added /projects and /platforms to the protected routes list in AuthProvider
Updated route matching to use startsWith for better coverage (supports nested routes)
Ensured unauthenticated users are redirected to /login
Preserved access for authenticated users
Improved redirect flow to prevent unnecessary navigation and potential loops
Removed unused React Router hooks (useLocation, useNavigate) to align with Next.js routing
✅ Acceptance Criteria
/projects is protected
/platforms is protected
Unauthenticated users are redirected to /login
Authenticated users can access both pages normally
No redirect loop introduced

Closes #157

- Added /projects and /platforms to protected routes list
- Ensured unauthenticated users are redirected to /login
- Used prefix matching to cover nested routes
- Fixed redirect logic to avoid unnecessary navigation and loops
- Removed unused React Router hooks (useLocation, useNavigate)
- Maintained access for authenticated users
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Apr 29, 2026

@Tobiloba0 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Eniola3321 Eniola3321 merged commit d8e07bf into ANYTECHS:main Apr 29, 2026
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.

/projects and /platforms pages are not protected by the auth guard

2 participants