Module: OTP::JWT::ActiveRecord
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/otp/jwt/active_record.rb
Overview
- ActiveRecord
-
concern.
Instance Method Summary collapse
-
#expire_jwt? ⇒ Boolean
Reset the [JWT] token if it is set to expire.
-
#to_jwt(claims = nil) ⇒ ActiveRecord::Base
Returns a [JWT] token for this record.
Instance Method Details
#expire_jwt? ⇒ Boolean
Reset the [JWT] token if it is set to expire
This method allows you to expire any token, independently from the JWT flags/payload.
54 55 56 57 |
# File 'lib/otp/jwt/active_record.rb', line 54 def expire_jwt? return self unless self.respond_to?(:expire_jwt_at) return self unless expire_jwt_at? && expire_jwt_at.past? end |