Scriptorium-CSC309 / web

An collaborative online code editor
0 stars 0 forks source link

Implement User Login #4

Open Ram-Raghav-S opened 8 hours ago

Ram-Raghav-S commented 8 hours ago

Description: Allow users to log in using token auth.

Tasks:

  1. Create API Endpoint:
    • Route: POST /api/auth/login
    • Controller:
      • Validate input data (email, password) using Joi.
      • Retrieve user by email from the database.
      • Compare provided password with stored hashed password using bcryptjs.
      • Generate a JWT token with user information.
      • Return the JWT token and user details.

Acceptance Criteria: