Skip to main content

Challenge — Add Authentication to Note Taker

Objective

Extend the Module 09 Note Taker API with full JWT authentication.

New Endpoints

MethodPathAccess
POST/api/auth/registerPublic
POST/api/auth/loginPublic
POST/api/auth/logoutAuthenticated
POST/api/auth/refreshVia cookie
GET/api/auth/meAuthenticated
GET/api/notesAuthenticated — own notes only

Requirements

  • Notes belong to users (add userId to Note model)
  • Users can only read/edit/delete their own notes
  • Passwords hashed with bcrypt (12 rounds)
  • JWT in Authorization header; refresh token in httpOnly cookie
  • Zod validation on register and login