Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.
/ api-auth-jwt Public archive

NodeJS API auth. TypeScript, JWT Auth, Postgres, TypeORM.

Notifications You must be signed in to change notification settings

geraldoam/api-auth-jwt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

API Auth JavaScript Web Token

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.

Tools & Packages

  • TypeScript.
  • Postgres with TypeORM.
  • JWT, Bcrypt.

API

Create User
/users

# post
{
  "email": "email@email.com",
  "password": "password"
}

# return
{
  "email": "email@email.com",
  "password": "password",
  "id": "id"
}
Login User
/login

# post
{
  "email": "teste04@gmail.com",
  "password": "123456"
}

# return
"(jwt token)"
Auth User (Authenticate with Middleware)
/users

# get | Bearer Token -> JWT Token

# return
{
  "userID": "(userId)"
}