-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Description
This is a follow-up to #1612 which was closed by #1625.
The PR fixed half of the problem. The issue is that the rake task doorkeeper:db:cleanup:expired_tokens will still delete tokens which haven't yet expired. The reason is that the expires_in column is not considered.
Compare the logic in
class StaleRecordsCleaner
# This method compares against `created_at`
def clean_expired(ttl)
table = @base_scope.arel_table
@base_scope
.where.not(expires_in: nil)
.where(table[:created_at].lt(Time.current - ttl))
.in_batches(&:delete_all)
end
endWith
module Expirable
# This method compares against `expires_at`
def expired?
!!(expires_in && Time.now.utc > expires_at)
end
endMetadata
Metadata
Assignees
Labels
No labels