Skip to content

Add JWT authentication with bearer token support #1

Description

@sonnymay

Summary

The API currently has no authentication layer. Adding JWT bearer token auth would make this a realistic production-quality service and demonstrate a key backend skill.

Acceptance criteria

  • POST /auth/register — create a user (email + hashed password via passlib)
  • POST /auth/token — return a signed JWT on valid credentials
  • Protected routes require a valid Authorization: Bearer <token> header
  • Invalid or expired tokens return 401 Unauthorized with a consistent error shape
  • Auth logic lives in app/auth/ (router, schemas, utils) — not mixed into task routes
  • Existing pytest suite still passes; add test_auth.py covering register, login, and rejection cases

Stack

python-jose or PyJWT for token signing · passlib[bcrypt] for password hashing · FastAPI Depends for route protection

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions