Password Reset
/api/v2/user/password/reset/${username}/${token}
Get
users
Purpose
To allow a registered user to reset his / her password.
URL Parameters [input]
{
username: string,
token: string
}
Returns if valid [output]
{
message: string,
error: 0
}
What the API does
- Fetches the
username
andtoken
from the URL as parameters. - Checks if there is a record in the
users
collection with theusername
supplied [404]. - Checks if the value of the
reset
field of the fetched record has a value oftrue
[403]. - Checks if the
token
supplied is valid and corresponds to the one saved in the fetched record [401]. - Sends an HTML file that allows the user to insert and post a new password to the API on /password-reset-post.