@log_action
def update_password_request(params, uid=None, check_current=False):

    user = get_user(uid=uid)

    if check_current and not api.auth.confirm_password(params["current-password"], user['password_hash']):
        raise WebException("Your current password is incorrect.")

    if params["new-password"] != params["new-password-confirmation"]:
        raise WebException("Your passwords do not match.")

    if len(params["new-password"]) == 0:
        raise WebException("Your password cannot be empty.")

    update_password(user['uid'], params["new-password"])
Update account password.
dataset/ETHPy150Open IceCTF/ctf-platform/api/api/user.py/update_password_request