summaryrefslogtreecommitdiff
path: root/app/models/webauthn_registration.rb
blob: 76f8faa11c7027d2d1f4e3e6389f3ddc92def94b (plain)
1
2
3
4
5
6
7
8
9
10
11
# frozen_string_literal: true

# Registration information for WebAuthn credentials

class WebauthnRegistration < ApplicationRecord
  belongs_to :user

  validates :credential_xid, :public_key, :name, :counter, presence: true
  validates :counter,
            numericality: { only_integer: true, greater_than_or_equal_to: 0, less_than_or_equal_to: 2**32 - 1 }
end