Open evgenyneu opened 1 year ago
+1 found the same on version 2.2.1
This is also true of two_factor_backupable
. If you follow the README and add unshift(:two_factor_backupable)
, the default_strategies
includes it twice. Like with authenticatable, declaring devise :two_factor_backupable
in the model is sufficient.
I think these strategies are automatically added to Warden by these lines.
Seems like the best solution is to simplify:
inject_strategies_into_warden_config
from the generator.unshift
instruction from the README.
Hi,
When I run the generator
It adds the following code to
config/initializers/devise.rb
file:However, everything works fine if I comment it out. Moreover, if I print out the array returned by
manager.default_strategies(:scope => :user)
it shows two duplicate items[:two_factor_authenticatable, :two_factor_authenticatable]
. I'm using this code to print it out:It looks like the generator for the
config/initializers/devise.rb
can be removed since the :two_factor_authenticatable Warden strategy for the User is already added when we do?
I'm using devise-two-factor (5.0.0), devise (4.8.1) and rails (7.0.3.1).