authentication-zero 2.16.21 → 2.16.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c87cbd4d780d1170998c49949d6f28dbe0305df16880f012a7fd6a9cd19ce698
4
- data.tar.gz: bb6dbd332c8d4fc221d4de3e8264204d0c999f1707f7529b3d547cb2eb4f5fe4
3
+ metadata.gz: 92a96efa7edf8438760960d32bc93e431f786889e95fd9a92343c96a19617edb
4
+ data.tar.gz: 8ae66c2b5b556df1281e8c49dd1c6879bbe118af1617838725f3dd7d251457fc
5
5
  SHA512:
6
- metadata.gz: dc453d93036ca66a4df78da04c2fb1da2a21e862a409bad8608ec1661b315c9670e126b5de14ccd1b0a6b4fedb0445f258b0a472cb6f81c90ef588a178484cfc
7
- data.tar.gz: c1d014b975a078302d919ba3ec52b4b2b4f0c94017cb04178785ae28bb5e5c8ff6e5d5e2fb84a8dc551cf3b5dc757c392af3061718ecf4e3a64c176292faaad2
6
+ metadata.gz: 02f153adacde895b01bf833726d3cfa4339cbe9665a60cc06ca0140b0fe64832c087f7c2b6ec139040cf6751def4ff0d2d5537576412adb02146fdd5c234e4ca
7
+ data.tar.gz: 87c0513ffa13f295c78fd054c12ee8d3e79f17464def8174394b0751915ae3f0777e3132b2cd3a0feb3c028118843b7473425513bb0534f726a1c9ab2ca51a51
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- authentication-zero (2.16.21)
4
+ authentication-zero (2.16.22)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,3 +1,3 @@
1
1
  module AuthenticationZero
2
- VERSION = "2.16.21"
2
+ VERSION = "2.16.22"
3
3
  end
@@ -2,12 +2,10 @@ class <%= migration_class_name %> < ActiveRecord::Migration[<%= ActiveRecord::Mi
2
2
  def change
3
3
  create_table :security_keys do |t|
4
4
  t.references :user, null: false, foreign_key: true
5
- t.string :name, null: false
6
- t.string :external_id, null: false
5
+ t.string :name, null: false
6
+ t.string :external_id, null: false, index: { unique: true }
7
7
 
8
8
  t.timestamps
9
9
  end
10
-
11
- add_index :security_keys, :external_id, unique: true
12
10
  end
13
11
  end
@@ -1,27 +1,22 @@
1
1
  class <%= migration_class_name %> < ActiveRecord::Migration[<%= ActiveRecord::Migration.current_version %>]
2
2
  def change
3
3
  create_table :users do |t|
4
- t.string :email, null: false
4
+ t.string :email, null: false, index: { unique: true }
5
5
  t.string :password_digest, null: false
6
6
 
7
7
  t.boolean :verified, null: false, default: false
8
8
  <%- if two_factor? %>
9
9
  t.string :otp_secret
10
10
  <%- end -%>
11
+ <%- if webauthn? %>
12
+ t.string :webauthn_id
13
+ <%- end -%>
11
14
  <%- if omniauthable? %>
12
15
  t.string :provider
13
16
  t.string :uid
14
17
  <%- end -%>
15
- <%- if webauthn? %>
16
- t.string :webauthn_id
17
- <%- end -%>
18
18
 
19
19
  t.timestamps
20
20
  end
21
-
22
- add_index :users, :email, unique: true
23
- <%- if omniauthable? -%>
24
- add_index :users, [:provider, :uid], unique: true
25
- <%- end -%>
26
21
  end
27
22
  end
@@ -31,7 +31,7 @@ class User < ApplicationRecord
31
31
  self.verified = false
32
32
  end
33
33
  <%- if webauthn? %>
34
- before_validation on: :create do
34
+ before_validation if: :otp_secret_changed?, on: :update do
35
35
  self.webauthn_id = WebAuthn.generate_user_id
36
36
  end
37
37
  <%- end -%>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: authentication-zero
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.16.21
4
+ version: 2.16.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nixon