Link Search Menu Expand Document

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 and token from the URL as parameters.
  • Checks if there is a record in the users collection with the username supplied [404].
  • Checks if the value of the reset field of the fetched record has a value of true [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.