Use SolidQueue in production. Use the find_by_token method, rather than iterating over refresh tokens, as we already fixed for tokens

This commit is contained in:
Dan Milne
2025-12-31 14:32:34 +11:00
parent a17c08c890
commit 40815d3576
3 changed files with 9 additions and 15 deletions

View File

@@ -10,6 +10,7 @@ class OidcRefreshToken < ApplicationRecord
before_validation :set_token_family_id, on: :create
validates :token_digest, presence: true, uniqueness: true
validates :token_prefix, presence: true
scope :valid, -> { where("expires_at > ?", Time.current).where(revoked_at: nil) }
scope :expired, -> { where("expires_at <= ?", Time.current) }