Returns corresponding user given JWT token.
URL : /users/self
Method : GET
Header :
"Content-type": "application/json"
"Authorization": "Bearer [token]"
Code : 200 OK
Body :
{
"_id": "[User ID]",
"email": "[User email]",
"password": "[User password]",
"type": "[User type]",
"verified": true,
"created_at": "[account creation date]",
"updated_at": "[last account update]",
"__v": 0
}
Condition : If token is wrong.
Code : 401 Unauthorized
Body :
{
"code": "InvalidCredentials",
"message": "caused by JsonWebTokenError: invalid signature"
}