Authenticates a user and generates a JWT token for them.
The Express request object.
The Express response object.
The next middleware function.
The new username for the user.
Authenticates a user and generates a JWT token for them.