Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: app/controllers/lost_password_controller.rb
- ===================================================================
- --- app/controllers/lost_password_controller.rb (revision 4821)
- +++ app/controllers/lost_password_controller.rb (working copy)
- @@ -59,15 +59,18 @@
- end
- if reset_token.respond_to?( :expires ) && reset_token.expires >= Time.now.utc
- - if reset_token.user.nil? # if user associated with this reset_token doesn't exist
- + user = reset_token.user
- +
- + if user.nil? # if user associated with this reset_token doesn't exist
- # Render show page
- render :action => :show and return
- end
- - reset_token.user.password = params[:password]
- - reset_token.user.password_confirmation = params[:password_confirmation]
- + user.password = params[:password]
- + user.password_confirmation = params[:password_confirmation]
- - if reset_token.user.save
- + if user.save
- + puts "Changed the password to #{user.password}"
- # Redirect to homepage or destination url
- redirect_to reset_token.destination_url.to_s.empty? ? '/' : reset_token.destination_url.to_s
- else
Add Comment
Please, Sign In to add comment