diff --git a/app/controllers/admin/account_recoveries_controller.rb b/app/controllers/admin/account_recoveries_controller.rb index 6c6d02b9..f190c68f 100644 --- a/app/controllers/admin/account_recoveries_controller.rb +++ b/app/controllers/admin/account_recoveries_controller.rb @@ -47,7 +47,7 @@ def fail_recovery(message) def find_by_token @token = params[:token] - @user = User.find(message_verifier.verify(@token)[:id]) + @user = User.find(message_verifier.verify(@token).symbolize_keys[:id]) return if @user fail_recovery(t("pages_core.account_recovery.invalid_request")) diff --git a/app/models/otp_secret.rb b/app/models/otp_secret.rb index b112aea5..5776f3aa 100644 --- a/app/models/otp_secret.rb +++ b/app/models/otp_secret.rb @@ -93,7 +93,7 @@ def valid_otp?(otp) end def verify_secret(signed) - payload = message_verifier.verify(signed) + payload = message_verifier.verify(signed).symbolize_keys raise "Wrong user" unless payload[:user_id] == user.id payload[:secret] diff --git a/spec/internal/config/application.rb b/spec/internal/config/application.rb index 9fae1d5e..717eb9ad 100644 --- a/spec/internal/config/application.rb +++ b/spec/internal/config/application.rb @@ -16,7 +16,12 @@ module Internal class Application < Rails::Application # Initialize configuration defaults for originally generated Rails version. - config.load_defaults 7.0 + config.load_defaults 7.1 + + # Please, add to the `ignore` list any other `lib` subdirectories that do + # not contain `.rb` files, or that should not be reloaded or eager loaded. + # Common ones are `templates`, `generators`, or `middleware`, for example. + config.autoload_lib(ignore: %w[assets tasks]) # Settings in config/environments/* take precedence over those # specified here. Application configuration should go into files diff --git a/spec/internal/config/environments/test.rb b/spec/internal/config/environments/test.rb index ca41ea9c..1b1e3f3d 100644 --- a/spec/internal/config/environments/test.rb +++ b/spec/internal/config/environments/test.rb @@ -26,7 +26,7 @@ config.action_controller.perform_caching = false # Raise exceptions instead of rendering exception templates. - config.action_dispatch.show_exceptions = false + config.action_dispatch.show_exceptions = :none # Disable request forgery protection in test environment. config.action_controller.allow_forgery_protection = false