Skip to content

Conversation

@ADARSHsri2004
Copy link
Contributor

@ADARSHsri2004 ADARSHsri2004 commented Oct 12, 2025

Description

Implemented the user login endpoint (POST /api/auth/login) for authentication.
This endpoint validates user credentials, compares hashed passwords using bcryptjs, and returns a JWT containing the user’s ID and role upon successful login.


Semver Changes

  • Minor (new features, no breaking changes)

Issues

Closes: #12


Acceptance Criteria

  • Create the controller, service, and route for login.
  • Find the user by email in the database.
  • Compare the provided password with the stored hash using bcryptjs.
  • If credentials are valid, generate a JWT containing the user's ID and role.
  • Return the generated JWT to the client.

Checklist

  • I have read the Contributing Guidelines
  • My code follows the project’s coding style and structure.
  • I have tested all new functionality manually.
  • I have added all required labels:
    • Type: Feature
    • Semver: Minor
    • PR:Accept
image image

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.

[Feature]: Implement User Login & JWT Generation

1 participant