/users/password: return 403 on auth failure
This commit is contained in:
parent
e16d842880
commit
1b145791e5
@ -123,3 +123,4 @@ Use the following request body:
|
|||||||
}
|
}
|
||||||
|
|
||||||
Send the user's current password in ``old``, and Sachet will change it to the password in ``new``.
|
Send the user's current password in ``old``, and Sachet will change it to the password in ``new``.
|
||||||
|
If the password is wrong, Sachet will return a ``403``.
|
||||||
|
@ -117,7 +117,7 @@ class PasswordAPI(MethodView):
|
|||||||
"message": "Invalid 'old' password.",
|
"message": "Invalid 'old' password.",
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
400,
|
403,
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
auth_user.password = auth_user.gen_hash(new_psswd)
|
auth_user.password = auth_user.gen_hash(new_psswd)
|
||||||
|
Loading…
Reference in New Issue
Block a user