Sha256: 0634ae9bf7a0e5e365f00bb45ffed8c4a316ce743ddaa4959841ea30ebda9e6c

Contents?: true

Size: 1.21 KB

Versions: 10

Compression:

Stored size: 1.21 KB

Contents

class Spree::Admin::UserPasswordsController < Devise::PasswordsController
  helper 'spree/base'

  include Spree::Core::ControllerHelpers::Auth
  include Spree::Core::ControllerHelpers::Common
  include Spree::Core::ControllerHelpers::Store

  helper 'spree/admin/navigation'
  helper 'spree/admin/tables'
  layout 'spree/layouts/admin'

  # 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
  #
  def create
    self.resource = resource_class.send_reset_password_instructions(params[resource_name])

    if resource.errors.empty?
      set_flash_message(:notice, :send_instructions) if is_navigational_format?
      respond_with resource, :location => spree.admin_login_path
    else
      respond_with_navigational(resource) { render :new }
    end
  end

  # Devise::PasswordsController allows for blank passwords.
  # Silly Devise::PasswordsController!
  # Fixes spree/spree#2190.
  def update
    if params[:spree_user][:password].blank?
      set_flash_message(:error, :cannot_be_blank)
      render :edit
    else
      super
    end
  end

end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
solidus_auth_devise-1.4.0 lib/controllers/backend/spree/admin/user_passwords_controller.rb
spree_auth_devise-3.1.0 lib/controllers/backend/spree/admin/user_passwords_controller.rb
spree_auth_devise-3.0.6 lib/controllers/backend/spree/admin/user_passwords_controller.rb
spree_auth_devise-3.0.5 lib/controllers/backend/spree/admin/user_passwords_controller.rb
solidus_auth_devise-1.3.0 lib/controllers/backend/spree/admin/user_passwords_controller.rb
solidus_auth_devise-1.2.3 lib/controllers/backend/spree/admin/user_passwords_controller.rb
solidus_auth_devise-1.2.2 lib/controllers/backend/spree/admin/user_passwords_controller.rb
solidus_auth_devise-1.2.1 lib/controllers/backend/spree/admin/user_passwords_controller.rb
solidus_auth_devise-1.2.0 lib/controllers/backend/spree/admin/user_passwords_controller.rb
solidus_auth_devise-1.1.0 lib/controllers/backend/spree/admin/user_passwords_controller.rb