Class: Spree::Admin::UserPasswordsController
- Inherits:
-
Devise::PasswordsController
- Object
- Devise::PasswordsController
- Spree::Admin::UserPasswordsController
- Includes:
- SetsUserLanguageLocaleKey, Core::ControllerHelpers::Auth, Core::ControllerHelpers::Common, Core::ControllerHelpers::Store
- Defined in:
- lib/controllers/backend/spree/admin/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
22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/controllers/backend/spree/admin/user_passwords_controller.rb', line 22 def create self.resource = resource_class.send_reset_password_instructions(params[resource_name]) (:notice, :send_instructions) if if resource.errors.empty? respond_with resource, location: admin_user_path(resource) else (resource) { render :new } end end |
#update ⇒ Object
Devise::PasswordsController allows for blank passwords. Silly Devise::PasswordsController! Fixes spree/spree#2190.
37 38 39 40 41 42 43 44 |
# File 'lib/controllers/backend/spree/admin/user_passwords_controller.rb', line 37 def update if params[:spree_user][:password].blank? (:error, :cannot_be_blank) render :edit else super end end |