Class: Spree::UserPasswordsController
- Inherits:
-
Devise::PasswordsController
- Object
- Devise::PasswordsController
- Spree::UserPasswordsController
- Includes:
- Core::ControllerHelpers::Auth, Core::ControllerHelpers::Common, Core::ControllerHelpers::Currency, Core::ControllerHelpers::Locale, Core::ControllerHelpers::Order, Core::ControllerHelpers::Store, LocaleUrls, SpreeI18n::ControllerLocaleHelper
- Defined in:
- lib/controllers/frontend/spree/user_passwords_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
Overridden due to bug in Devise.
-
#update ⇒ Object
Devise::PasswordsController allows for blank passwords.
Instance Method Details
#create ⇒ Object
Overridden due to bug in Devise.
respond_with resource, :location => new_session_path(resource_name)
is generating bad url /session/new.user
overridden to:
respond_with resource, :location => spree.login_path
29 30 31 32 33 34 35 36 37 38 |
# File 'lib/controllers/frontend/spree/user_passwords_controller.rb', line 29 def create self.resource = resource_class.send_reset_password_instructions(params[resource_name], current_store) if resource.errors.empty? (:notice, :send_instructions) if respond_with resource, location: spree.login_path else (resource) { render :new } end end |
#update ⇒ Object
Devise::PasswordsController allows for blank passwords. Silly Devise::PasswordsController! Fixes spree/spree#2190.
43 44 45 46 47 48 49 50 51 52 |
# File 'lib/controllers/frontend/spree/user_passwords_controller.rb', line 43 def update if params[:spree_user][:password].blank? self.resource = resource_class.new resource.reset_password_token = params[:spree_user][:reset_password_token] (:error, :cannot_be_blank) render :edit else super end end |