Skip to content

Latest commit

 

History

History
59 lines (41 loc) · 1.87 KB

README.md

File metadata and controls

59 lines (41 loc) · 1.87 KB

jwt-service


Creating new JWT token

POST /generate (Generate a new JWT token given the info)
Body (application/json or application/x-www-form-urlencoded)
key required data type description
id true string N/A
mail true string N/A
name true string N/A
Responses
http code content-type response
200 application/json {"message": "Success", "token": "Bearer your_token"}
400, 500 application/json {"message": "Failed", "error":"Error messages"}

Verifying existing JWT token

GET /verify (Verify a existing JWT token)
Headers
key value description
Authorization The JWT token Starts with Bearer<space>
Responses
type jwtContent = {
  id: string
  mail: string
  name: string
}
http code content-type response
200 application/json {"message": "Success", "jwtContent": jwtContent}
400 application/json {"message": "Failed", "error":"Error messages"}