skye8-tech / openFolio-v1-functional

0 stars 11 forks source link

Implement Middleware to Protect Routes Requiring Authentication #6

Open andrew21-mch opened 3 months ago

andrew21-mch commented 3 months ago

Create middleware to protect routes that require user authentication. This middleware will ensure that only logged-in users can access specific pages, such as the dashboard and profile edit pages. If a user is not authenticated, they should be redirected to the login page.

Steps to Complete:

Create a PHP middleware function that checks if a user is authenticated by verifying session data. Apply this middleware to all routes that require authentication. Redirect unauthenticated users to the login page with an appropriate message. Acceptance Criteria:

Only authenticated users can access protected routes. Unauthenticated users are redirected to the login page.