Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Activate users responding to a reset password email #67

Closed
wants to merge 1 commit into from

2 participants

@d00n

No description provided.

@bborn
Owner

User#activate uses update_attribute, and saves the user. Is there a reason why you're setting last_request_at here? Should this get set by Authlogic when they're logged in?

Thanks for the addition; please revise and add tests so I can merge it in.

@bborn bborn closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 11, 2012
  1. @d00n
This page is out of date. Refresh to see the latest.
Showing with 7 additions and 0 deletions.
  1. +7 −0 app/controllers/password_resets_controller.rb
View
7 app/controllers/password_resets_controller.rb
@@ -27,6 +27,13 @@ def edit
def update
@user.password = params[:password]
@user.password_confirmation = params[:password_confirmation]
+
+ # If the user is clicking on a 'reset password' link we emailed him, he's confirming that email
+ if !@user.active?
+ @user.activate
+ @user.last_request_at = Time.now
+ @user.save
+ end
if @user.save
flash[:notice] = :your_changes_were_saved.l
Something went wrong with that request. Please try again.