Module: Doorkeeper::Models::Reusable
- Included in:
- AccessTokenMixin
- Defined in:
- lib/doorkeeper/models/concerns/reusable.rb
Instance Method Summary collapse
-
#reusable? ⇒ Boolean
Indicates whether the object is reusable (i.e. It is not expired and has not crossed reuse_limit).
Instance Method Details
#reusable? ⇒ Boolean
Indicates whether the object is reusable (i.e. It is not expired and has not crossed reuse_limit).
10 11 12 13 14 15 16 |
# File 'lib/doorkeeper/models/concerns/reusable.rb', line 10 def reusable? return false if expired? return true unless expires_in threshold_limit = 100 - Doorkeeper.config.token_reuse_limit expires_in_seconds >= threshold_limit * expires_in / 100 end |