Its been a while
CI / scan_ruby (push) Failing after 2m13s
CI / lint (push) Failing after 20s

This commit is contained in:
Jason Jordan
2026-07-23 10:41:46 -04:00
parent 16fadfd529
commit 9853d58469
83 changed files with 1978 additions and 243 deletions
+16
View File
@@ -0,0 +1,16 @@
class RetiredToken < ApplicationRecord
belongs_to :user
validates :jti, presence: true, uniqueness: true
validates :exp, presence: true
# check if a token is retired
def self.retired?(jti)
exists?(jti: jti)
end
# cleanup expired tokens (run this via a scheduled job)
def self.cleanup_expired
where("exp < ?", Time.current).delete_all
end
end