Skip to content

Auth: register, login, JWT issuance #2

Description

@Martins0152

Description
Implement POST /api/v1/auth/register and POST /api/v1/auth/login using the User model from prisma/schema.prisma.

Acceptance Criteria

  • Registration validates email format, rejects duplicate emails, and hashes passwords (bcrypt, cost factor >= 10).
  • Login verifies credentials and returns a JWT containing a canonical id claim (per README's auth convention).
  • Invalid credentials return 401 with the standard error envelope, not a stack trace.
  • JWT secret and expiry are read from .env, never hardcoded.
  • Unit tests cover: successful registration, duplicate email rejection, successful login, wrong password rejection.
  • Endpoints are documented in openapi.yaml with request/response examples.

Suggested reward: $25-$35

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    authAuthentication/authorizationbackendBackend/API workmediumModerate complexity

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions