-
Notifications
You must be signed in to change notification settings - Fork 0
0.1 | User and Authentication API
To perform any login services, a JWT token must be in the header of the request.
Log in to a user account.
body: { username: String, password: String }
return: A JWT token if success. entity: { accessToken, user: { _id, username, name } }
.
If the header of the request does not contain a valid token, or the token has expired, the operation will not be performed.
Create a new user.
body: { username: String, password: String, name: String }
header: Authorization: "Bearer TOKEN"
return: The created user.
Delete a user.
body: { username: String }
header: Authorization: "Bearer TOKEN"
return: The deleted user.
Get users based on the given key-value pair. The key should be either username or name. The value should be part of the content for the given key but not case-sensitive. If the value is an empty string, all users will be returned
body: { key: String, value: String }
header: Authorization: "Bearer TOKEN"
return: Array of users. Password attribute will not be return