Skip to content

feat: add ProtectedRoute component for authenticated routes#55

Merged
ayshadogo merged 1 commit intoDfunder:mainfrom
jobbykings:main
Mar 7, 2026
Merged

feat: add ProtectedRoute component for authenticated routes#55
ayshadogo merged 1 commit intoDfunder:mainfrom
jobbykings:main

Conversation

@jobbykings
Copy link
Contributor

Summary

Implements a ProtectedRoute component to restrict access to authenticated users only.

Changes Made

  • ✅ Created ProtectedRoute.jsx component
  • ✅ Wrapped dashboard and campaign creation routes with protection
  • ✅ Enhanced Login component to handle redirect after authentication
  • ✅ Added redirect query parameter functionality

Acceptance Criteria Met

  • Unauthenticated users are redirected to login
  • After login, users are redirected back to intended page
  • Dashboard and campaign creation routes are protected

Testing

Test accessing /dashboard and /create without authentication - should redirect to login with redirect parameter.

closes #32

- Create ProtectedRoute component that restricts access to authenticated users
- Redirect unauthenticated users to login with redirect query param
- Wrap dashboard and campaign creation routes with ProtectedRoute
- Enhance Login component to handle redirect after successful login
- Fixes issue requiring authentication protection for sensitive routes
@ayshadogo ayshadogo merged commit 2320a85 into Dfunder:main Mar 7, 2026
3 checks passed
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.

Protected Route Component

2 participants