With this simple app you can send email and password req and create a token when auth. You can verify the token and return user id from db.
- TypeScript.
- Postgres with TypeORM.
- JWT, Bcrypt.
/users
# post
{
"email": "email@email.com",
"password": "password"
}
# return
{
"email": "email@email.com",
"password": "password",
"id": "id"
}
/login
# post
{
"email": "teste04@gmail.com",
"password": "123456"
}
# return
"(jwt token)"
/users
# get | Bearer Token -> JWT Token
# return
{
"userID": "(userId)"
}