791cc9138b
- 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.
13 lines
336 B
Ruby
13 lines
336 B
Ruby
class CreateU2fRegistrations < ActiveRecord::Migration
|
|
def change
|
|
create_table :u2f_registrations do |t|
|
|
t.text :certificate
|
|
t.string :key_handle, index: true
|
|
t.string :public_key
|
|
t.integer :counter
|
|
t.references :user, index: true, foreign_key: true
|
|
|
|
t.timestamps null: false
|
|
end
|
|
end
|
|
end
|