Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I'm working on an app use
two_factor_backupable
ofdevise-two-factor
. It really helpful, thank for that!I detected there are two problems may need to be fixed.
Problem 01: Remove duplicate of register
two_factor_authenticatable
strategy.The gem registers
two_factor_authenticatable
strategy on generations.two_factor_authenticatable
into model.Problem 02: It happens again with
two_factor_backupable
in another way.The installation instruction of
two_factor_backupable
in README.md file requires to addtwo_factor_backupable
to both model and Devise initializer.Checking on
waden
, it is duplicated.So I think the requirement to add `:two_factor_backupable` into devise initializer is redundant.
Why it should be fixed?
By default, the
devise
gem will look through and run all of the strategies. So the strategy will be executed 2 times. It definitely takes time and may generate the unexpected problem.EX: The
devise-two-factor
force cascade to the next strategy if the current one fails. This is the cause offailed attempt
increase multi-time on one user request.Ruby version:
ruby 2.5.1p57
Rails version:
Rails 5.2.0