lib/doorkeeper/models/concerns/revocable.rb in doorkeeper-5.2.6 vs lib/doorkeeper/models/concerns/revocable.rb in doorkeeper-5.3.0
- old
+ new
@@ -17,35 +17,8 @@
# @return [Boolean] true if revoked, false in other case
#
def revoked?
!!(revoked_at && revoked_at <= Time.now.utc)
end
-
- # Revokes token with `:refresh_token` equal to `:previous_refresh_token`
- # and clears `:previous_refresh_token` attribute.
- #
- def revoke_previous_refresh_token!
- return unless refresh_token_revoked_on_use?
-
- old_refresh_token&.revoke
- update_attribute :previous_refresh_token, ""
- end
-
- private
-
- # Searches for Access Token record with `:refresh_token` equal to
- # `:previous_refresh_token` value.
- #
- # @return [Doorkeeper::AccessToken, nil]
- # Access Token record or nil if nothing found
- #
- def old_refresh_token
- @old_refresh_token ||=
- AccessToken.by_refresh_token(previous_refresh_token)
- end
-
- def refresh_token_revoked_on_use?
- AccessToken.refresh_token_revoked_on_use?
- end
end
end
end