$data->username, 'password' => $_POST['password']]; $user = UserController::authenticate($info); if (!$user) { Http::redirect('account.php', ['error' => '1']); } $user->password = password_hash($_POST['new_password'], PASSWORD_DEFAULT); $user->save(); Http::redirect('index.php');