Skip to content

Conversation

@nicoleluo7
Copy link
Collaborator

Summary

This PR implements a basic authentication flow for the website. It introduces a login page with hardcoded credentials and protects the /resume-book route so only authenticated users can access it.

Changes Made

  1. Login Page (Login.jsx and Login.css)
  • Added login form with username and password fields
  • Currently, there are hardcoded credentials for username and password for demonstration purposes.
  • Error message is displayed for invalid credentials
  1. PrivateRoute Component (PrivateRoute.jsx)
  • Wraps protected routes
  • Checks for authentication, redirects unauthenticated users to /login
  1. App Routing (App.js)
  • Added /login route
  • Wrapped /resume-book with PrivateRoute to require authentication

Testing

  1. Navigate to /resume-book directly; you should be redirected to /login.
  2. Log in with "username" and "password".
  3. On successful login, you should be redirected to /resume-book.
  4. Invalid credentials should show an error message

Notes

  • This is currently a simple, client-side authentication for demonstration only.
  • Credentials and authentication logic should be replaced with a secure backend in the future

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