Files
openfoodnetwork/app/controllers/spree/user_passwords_controller.rb
David Rodríguez 4c6d894bc0 Bump RuboCop to 1.86.6
There were a few changes needed:

* Plugins are now specified through `plugin:` config keyword.
* All plugin gems need to be specified explicitly in Gemfile since they
  are no longer dependencies of plugins already specified explicitly.
* All plugin gems need to be updated in other to use the new APIs.
* One cop was renamed.
* New offenses safe to correct were corrected directly with `bundle exec
  rubocop -a`.
* New offenses unsafe to correct were added to the TODO configuration
  with `bundle exec rubocop --auto-gen-config --auto-gen-only-exclude
  --exclude-limit 1400 --no-auto-gen-timestamp`.
2025-10-27 11:30:33 +01:00

35 lines
953 B
Ruby

# frozen_string_literal: true
require "spree/core/controller_helpers/auth"
require "spree/core/controller_helpers/common"
require "spree/core/controller_helpers/order"
module Spree
class UserPasswordsController < Devise::PasswordsController
helper 'spree/base'
include RawParams
include Spree::Core::ControllerHelpers::Auth
include Spree::Core::ControllerHelpers::Common
include Spree::Core::ControllerHelpers::Order
include I18nHelper
before_action :set_locale
# Devise::PasswordsController allows for blank passwords.
# Silly Devise::PasswordsController!
# Fixes spree/spree#2190.
def update
if params.dig(:spree_user, :password).blank?
self.resource = resource_class.new
resource.reset_password_token = params.dig(:spree_user, :reset_password_token)
set_flash_message(:error, :cannot_be_blank)
render :edit
else
super
end
end
end
end