Allow model config to override sign_in_after_change_password (#5825)

The config exists at the model/resource class from the registerable
module, but it was not being honored, instead we were directly relying
on the main Devise config.

Now this can be configured and honored per-model/resource class, as
expected.

This is similar to #5429 and `sign_in_after_reset_password` fix.
This commit is contained in:
Carlos Antonio da Silva
2026-02-18 09:43:10 -03:00
committed by GitHub
parent e5ffdc4248
commit bb2b4ecc1b
3 changed files with 22 additions and 1 deletions

View File

@@ -163,6 +163,6 @@ class Devise::RegistrationsController < DeviseController
def sign_in_after_change_password?
return true if account_update_params[:password].blank?
Devise.sign_in_after_change_password
resource_class.sign_in_after_change_password
end
end