Class: MerbAuthSlicePasswordReset::Passwords
- Inherits:
-
Application
- Object
- Merb::Controller
- Application
- MerbAuthSlicePasswordReset::Passwords
- Defined in:
- app/controllers/passwords.rb
Instance Method Summary collapse
Instance Method Details
#forgot_password ⇒ Object
3 4 5 6 |
# File 'app/controllers/passwords.rb', line 3 def forgot_password @login_param_name = Merb::Authentication::Strategies::Basic::Base.login_param render end |
#reset ⇒ Object
20 21 22 23 24 25 |
# File 'app/controllers/passwords.rb', line 20 def reset session.user = Merb::Authentication.user_class.find_with_password_reset_code(params[:password_reset_code]) raise NotFound if session.user.nil? session.user.reset_password! redirect_after_password_reset end |
#send_confirmation ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 |
# File 'app/controllers/passwords.rb', line 8 def send_confirmation @login_param_name = Merb::Authentication::Strategies::Basic::Base.login_param @user = Merb::Authentication.user_class.find_with_login_param(@login_param_name, params[@login_param_name]) if @user @user.send_password_reset_notification redirect_after_sending_confirmation else [:error] = "User with #{@login_param_name} \"%s\" not found".t(params[@login_param_name].freeze) render :forgot_password end end |