9b6c3209f4771089ca721d40cb96ff49b348e802Eugen Kuksa scope :expired, ->() { where('expiration <= ?', Time.now) }
5513a7cc4f5859d263e4cb66ae93e8dbfcf3681fEugen Kuksa scope :unexpired, ->() { where('expiration > ?', Time.now) }
0050586f79baaf40dbe2cba81c239cad7939b283Eugen Kuksa # Although unlikely, the token could clash with another one. Generate tokens
0050586f79baaf40dbe2cba81c239cad7939b283Eugen Kuksa # until there is no conflict. This should converge extremely fast.
8b99a5dcb32ab1c94dd8bd214cf73a2bf9e15a92Eugen Kuksa while access_token.nil? || access_token.invalid?
e5f7f6deff59acd41803916bae31e2cea5a23a91Eugen Kuksa AccessTokenDeletionWorker.perform_at(access_token.expiration)