NestJS Authentication with JWT, PassportJs, and Prisma
DATABASE_URL="" JWT_SECRET=""
/auth/login
Method: POST
Description: Authenticates a user and returns a JWT token.
Body:
{ "email": "string", "password": "string" }
/auth/register
Method: POST
Description: Registers a new user and returns a user info.
Body:
{ "name": "string", "email": "string", "password": "string" }
/auth/profile
Method: GET
Description: Retrieves user profile information. Requires a Bearer token for authentication.
Body:
Authorization: Bearer
All kind of contributions are welcome, please feel free to submit pull requests.
The above is the detailed content of Authentication in NestJS with PassportJS and Prisma. For more information, please follow other related articles on the PHP Chinese website!