Add a `U2fRegistrations` table/model.
- To hold registrations from U2F devices, and to authenticate them.
- Previously, `User#two_factor_enabled` was aliased to the
`otp_required_for_login` column on `users`.
- This commit changes things a bit:
- `User#two_factor_enabled` is not a method anymore
- `User#two_factor_enabled?` checks both the
`otp_required_for_login` column, as well as `U2fRegistration`s
- Change all instances of `User#two_factor_enabled` to
`User#two_factor_enabled?`
- Add the `u2f` gem, and implement registration/authentication at the
model level.
Showing
... | @@ -45,6 +45,7 @@ gem 'akismet', '~> 2.0' | ... | @@ -45,6 +45,7 @@ gem 'akismet', '~> 2.0' |
gem 'devise-two-factor', '~> 3.0.0' | gem 'devise-two-factor', '~> 3.0.0' | ||
gem 'rqrcode-rails3', '~> 0.1.7' | gem 'rqrcode-rails3', '~> 0.1.7' | ||
gem 'attr_encrypted', '~> 3.0.0' | gem 'attr_encrypted', '~> 3.0.0' | ||
gem 'u2f', '~> 0.2.1' | |||
# Browser detection | # Browser detection | ||
gem "browser", '~> 1.0.0' | gem "browser", '~> 1.0.0' | ||
... | ... |
app/models/u2f_registration.rb
0 → 100644
spec/factories/u2f_registrations.rb
0 → 100644
Please
register
or
sign in
to comment