Skip to content

feat: Add user authentication #3

@datnguyen1

Description

@datnguyen1

Summary

Add user authentication so comics can be associated with users and access can be controlled.

Scope

  • Backend: JWT-based auth (register, login, logout)
  • Backend: Protect comic routes (create/update/delete require auth; list/detail can be public)
  • Backend: Associate comics with author (user ID)
  • Frontend: Login/register pages
  • Frontend: Auth context or state (store token, user)
  • Frontend: Guard create/edit routes; show "My Comics" vs public list
  • Persist token (e.g. localStorage) and handle refresh/expiry

Notes

  • Auth middleware and JWT_SECRET already exist in backend/src/middleware/auth.js but may need wiring.
  • Comic model has author: ObjectId field.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions