Browse Source

Try just explicitly doing the unlock on password reset

pull/2898/head
Rachael Booth 4 months ago
parent
commit
1d39159bff
  1. 2
      app/controllers/auth/passwords_controller.rb
  2. 2
      config/initializers/devise.rb

2
app/controllers/auth/passwords_controller.rb

@ -35,7 +35,7 @@ class Auth::PasswordsController < Devise::PasswordsController
yield resource if block_given? yield resource if block_given?
if resource.errors.empty? if resource.errors.empty?
resource.unlock_access! if unlockable?(resource) resource.unlock_access! if resource.respond_to?(:unlock_access!)
if Devise.sign_in_after_reset_password if Devise.sign_in_after_reset_password
set_flash_message!(:notice, password_update_flash_message) set_flash_message!(:notice, password_update_flash_message)
resource.after_database_authentication resource.after_database_authentication

2
config/initializers/devise.rb

@ -205,7 +205,7 @@ Devise.setup do |config|
# :time = Re-enables login after a certain amount of time (see :unlock_in below) # :time = Re-enables login after a certain amount of time (see :unlock_in below)
# :both = Enables both strategies # :both = Enables both strategies
# :none = No unlock strategy. You should handle unlocking by yourself. # :none = No unlock strategy. You should handle unlocking by yourself.
config.unlock_strategy = :both config.unlock_strategy = :time
# Number of authentication tries before locking an account if lock_strategy # Number of authentication tries before locking an account if lock_strategy
# is failed attempts. # is failed attempts.

Loading…
Cancel
Save