Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # mysite.com/controller/reset_password/4c769d47dde313fd9b385e8de2e1a9e047ccc417
- def reset_password
- user = User.find_by_password_reset_code(params[:id])
- return if user unless params[:password]
- if (params[:password] == params[:password_confirmation])
- self.current_user = user
- current_user.password_confirmation = params[:password_confirmation]
- current_user.password = params[:password]
- user.reset_password
- end
- redirect_back_or_default(:controller => '/account', :action => 'index')
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement