class Spree::Admin::UserPasswordsController

Public Instance Methods

create() click to toggle source

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
# 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])

  set_flash_message(:notice, :send_instructions) if is_navigational_format?

  if resource.errors.empty?
    respond_with resource, location: admin_user_path(resource)
  else
    respond_with_navigational(resource) { render :new }
  end
end
update() click to toggle source

Devise::PasswordsController allows for blank passwords. Silly Devise::PasswordsController! Fixes spree/spree#2190.

Calls superclass method
# File lib/controllers/backend/spree/admin/user_passwords_controller.rb, line 37
def update
  if params[:spree_user][:password].blank?
    set_flash_message(:error, :cannot_be_blank)
    render :edit
  else
    super
  end
end