-
loginUser: Accept username & password from client - Fetch user from DB by name
- Compare password using
bcrypt.CompareHashAndPassword(...) - Generate JWT token if login is successful
- Return token to client
- Add JWT middleware to protected routes
- Parse
Authorization: Bearer <token>header in requests - Validate token signature and expiration
- Extract
namefrom token and check user exists
-
loginUserroute stub exists - Bcrypt hashing & checking already implemented
- User creation with bcrypt hashing
- User retrieval from DB
- TLS support for secure transport