General response:
-
When success, returns status code 200 OK
-
When failed, an array of error messages in the body
Set HTTP header Authorization to 'Bearer TOKEN' where TOKEN is the JWT token received in api/users/login
Must be authorized as an Admin!
Request body:
{
"FirstName": "Ivan",
"LastName": "Vasiliev",
"Email": "ivan.vasilie@gmail.com",
"Password": "passwordWithCapsAndDigits",
"Role": "Admin"
}
Request body:
{
"Email": "ivan.vasilie@gmail.com",
"Password": "passwordWithCapsAndDigits"
}
Response body:
{
"token": "JWT-TOKEN-WILL-BE-HERE",
"email": "USER-EMAIL-AKA-USER-NAME"
}
Response cookie: httpOnly cookie 'refreshToken'.
Request: send JWT token in Authorization header & cookie 'refreshToken'
Response:
{
"token": "JWT-TOKEN-WILL-BE-HERE"
}
Response cookie: httpOnly cookie 'refreshToken'.
Request: send JWT token in Authorization header & cookie 'refreshToken'