From 06ecdd9e517dd0203d9f37f57e5922a3ea95ead3 Mon Sep 17 00:00:00 2001 From: Karina Kwiatek Date: Sat, 18 Feb 2023 15:46:09 +0100 Subject: [PATCH] Upgrade Devise to 4.9.0 --- Gemfile.lock | 2 +- config/initializers/devise.rb | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 3615d3ad..d4903cfe 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -117,7 +117,7 @@ GEM database_cleaner-core (2.0.1) date (3.3.3) debug_inspector (1.1.0) - devise (4.8.1) + devise (4.9.0) bcrypt (~> 3.0) orm_adapter (~> 0.1) railties (>= 4.1.0) diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index 1345aea6..947195a4 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -253,4 +253,19 @@ Devise.setup do |config| # When using omniauth, Devise cannot automatically set Omniauth path, # so you need to do it manually. For the users scope, it would be: # config.omniauth_path_prefix = '/my_engine/users/auth' + + # ==> Hotwire/Turbo configuration + # When using Devise with Hotwire/Turbo, the http status for error responses + # and some redirects must match the following. The default in Devise for existing + # apps is `200 OK` and `302 Found respectively`, but new apps are generated with + # these new defaults that match Hotwire/Turbo behavior. + # Note: These might become the new default in future versions of Devise. + config.responder.error_status = :unprocessable_entity + config.responder.redirect_status = :see_other + + # ==> Configuration for :registerable + + # When set to false, does not sign a user in automatically after their password is + # changed. Defaults to true, so a user is signed in automatically after changing a password. + # config.sign_in_after_change_password = true end