Extract SIGN_COUNT_LIMIT
constant in WebauthnCredential
class (#30636)
This commit is contained in:
parent
921b0db544
commit
d818ddd687
2 changed files with 5 additions and 3 deletions
|
@ -15,9 +15,11 @@
|
|||
#
|
||||
|
||||
class WebauthnCredential < ApplicationRecord
|
||||
SIGN_COUNT_LIMIT = (2**63)
|
||||
|
||||
validates :external_id, :public_key, :nickname, :sign_count, presence: true
|
||||
validates :external_id, uniqueness: true
|
||||
validates :nickname, uniqueness: { scope: :user_id }
|
||||
validates :sign_count,
|
||||
numericality: { only_integer: true, greater_than_or_equal_to: 0, less_than_or_equal_to: (2**63) - 1 }
|
||||
numericality: { only_integer: true, greater_than_or_equal_to: 0, less_than_or_equal_to: SIGN_COUNT_LIMIT - 1 }
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue