app/controllers/authentication_controller.rb
# The user has entered a new password.  Need to verify and save.
# HTTP put

The user has entered a new password.  Need to verify and save.
HTTP put
The user has entered a new password . Need to verify and save . HTTP put
def new_password
    username = params[:user][:username]
    @user = User.find_by_username(username)
    if verify_new_password(params[:user])
      @user.update(params[:user])
      @user.password = @user.new_password
      if @user.valid?
        clear_password_reset(@user)
        @user.save
        flash[:notice] = 'Your password has been reset.  Please sign in with your new password.'
        redirect_to :sign_in
      else
        render :action => "password_reset"
      end
    else
      @user.errors[:new_password] = 'Cannot be blank and must match the password verification.'
      render :action => "password_reset"
    end
  end
def new_password username = params [ :user ] [ :username ] @user = User . find_by_username ( username ) if verify_new_password ( params [ :user ] ) @user . update ( params [ :user ] ) @user . password = @user . new_password if @user . valid? clear_password_reset ( @user ) @user . save flash [ :notice ] = 'Your password has been reset.  Please sign in with your new password.' redirect_to :sign_in else render :action => "password_reset" end else @user . errors [ :new_password ] = 'Cannot be blank and must match the password verification.' render :action => "password_reset" end end
The user has entered a new password.
The user has entered a new password .