I tried lots of other combinations (@user.save in controller,
rearranging code, etc.), but nothing worked unless I explicitly logged
the user in.
password_resets_controller.rb:
def update
if @user.reset_password!(params[:password], params
[:password_confirmation])
flash[:notice] = "Password successfully reset"
# Authlogic is supposed to automatically login, but it doesn't
seem to for me.
UserSession.create!(:email => @user.email, :password =>
@user.password, :remember_me => false)
redirect_to(home_path)
else
flash[:error] = build_errors_for_flash(@user, "Password could
not be reset. Please try again.")
render :action => :edit
end
end
Anyone have any ideas? Is there a setting I have that shuts this off?
My user.rb:
acts_as_authentic do |c|
c.transition_from_restful_authentication true
c.login_field :email
c.validate_email_field false
c.perishable_token_valid_for 1.hour
c.ignore_blank_passwords false
end
My user_session.rb:
generalize_credentials_error_messages true
find_by_login_method :find_by_all_emails
remember_me_for 2.weeks