Long-lasting project invitation links pose a security risk because email address ownership can change over time. I've noticed other providers expire these links after 7 days, which I believe is a good practice. Therefore, I've implemented the same feature. This prog now expires project invitation links every 7 days, with checks occurring every 6 hours.
10 lines
206 B
Ruby
10 lines
206 B
Ruby
# frozen_string_literal: true
|
|
|
|
class Prog::ExpireProjectInvitations < Prog::Base
|
|
label def wait
|
|
ProjectInvitation.where { _1.expires_at < Time.now }.all.each(&:destroy)
|
|
|
|
nap 6 * 60 * 60
|
|
end
|
|
end
|