Password Change - MarcoLagalla/marette_backend GitHub Wiki
Name | Password Change |
---|---|
Description | Change user's password and renew auth token |
URL | api/v1/account/password/<int:id> /change |
Allowed methods | PUT |
Authorizations | IsAuthenticated |
-
<int:id>
is the user's id as returned by UserProfile
It allows an authenticated user to change his own password. Destroys and renew the stored authentication token, this action has to be performed also by the client, updating the auth_token cookie.
Field | Type | Required | Unique | Comments |
---|---|---|---|---|
old_password |
string | yes | no | |
new_password |
string | yes | no | |
new_password2 |
string | yes | no |
HTTP_200_OK
{
"password": "password changed",
"token": "f090e198ad841e72f2176d9be2645833034d597a"
}
HTTP_403_FORBIDDEN
If the Auth Token is missing.
{
"detail": "Authentication credentials were not provided."
}
HTTP_400_BAD_REQUEST
If old_password
is wrong.
{
"old_password": "wrong password."
}