You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: passwords_controller.rb
    path of file: ./repos/rubyvideo/app/controllers
    
    the code of the file until where you have to start completion: class Passwor
    
  def update
    if !@user.authenticate(params[:current_password])
      redirect_to edit_password_path, alert: "The current password you entered is incorrect"
    elsif @user.update(user_params)
      redirect_to root_path, notice: "Your password has been changed"
    else
      render :edit, status: :unprocessable_entity
    end