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.
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.