Class: Refinery::PasswordsController
- Inherits:
-
Devise::PasswordsController
- Object
- Devise::PasswordsController
- Refinery::PasswordsController
- Defined in:
- app/controllers/refinery/passwords_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /registrations/password.
-
#edit ⇒ Object
GET /registrations/password/edit?reset_password_token=abcdef.
Instance Method Details
#create ⇒ Object
POST /registrations/password
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'app/controllers/refinery/passwords_controller.rb', line 32 def create if params[:refinery_user].present? and (email = params[:refinery_user][:email]).present? and (user = User.where(:email => email).first).present? # Call devise reset function. user.send(:generate_reset_password_token!) UserMailer.reset_notification(user, request).deliver redirect_to refinery.login_path, :notice => t('email_reset_sent', :scope => 'refinery.users.forgot') else flash.now[:error] = if (email = params[:refinery_user][:email]).blank? t('blank_email', :scope => 'refinery.users.forgot') else t('email_not_associated_with_account_html', :email => ERB::Util.html_escape(email), :scope => 'refinery.users.forgot').html_safe end render :new end end |
#edit ⇒ Object
GET /registrations/password/edit?reset_password_token=abcdef
22 23 24 25 26 27 28 29 |
# File 'app/controllers/refinery/passwords_controller.rb', line 22 def edit if params[:reset_password_token] and (@refinery_user = User.where(:reset_password_token => params[:reset_password_token]).first).present? respond_with(@refinery_user) else redirect_to refinery.new_refinery_user_password_path, :flash => ({ :error => t('code_invalid', :scope => 'refinery.users.reset') }) end end |