about summary refs log tree commit diff
path: root/app/models
diff options
context:
space:
mode:
Diffstat (limited to 'app/models')
-rw-r--r--app/models/system_key.rb2
-rw-r--r--app/models/webauthn_credential.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/app/models/system_key.rb b/app/models/system_key.rb
index f17db7c2d..1be399dd6 100644
--- a/app/models/system_key.rb
+++ b/app/models/system_key.rb
@@ -14,7 +14,7 @@ class SystemKey < ApplicationRecord
 
   before_validation :set_key
 
-  scope :expired, ->(now = Time.now.utc) { where(arel_table[:created_at].lt(now - ROTATION_PERIOD * 3)) }
+  scope :expired, ->(now = Time.now.utc) { where(arel_table[:created_at].lt(now - (ROTATION_PERIOD * 3))) }
 
   class << self
     def current_key
diff --git a/app/models/webauthn_credential.rb b/app/models/webauthn_credential.rb
index 7d423e38d..48abfc1d4 100644
--- a/app/models/webauthn_credential.rb
+++ b/app/models/webauthn_credential.rb
@@ -18,5 +18,5 @@ class WebauthnCredential < ApplicationRecord
   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: (2**63) - 1 }
 end