Module: OTP::JWT::ActiveRecord

Extended by:
ActiveSupport::Concern
Defined in:
lib/otp/jwt/active_record.rb

Overview

ActiveRecord

concern.

Instance Method Summary collapse

Instance Method Details

#to_jwtActiveRecord::Base

Returns a [JWT] token for this record

Returns:

  • (ActiveRecord::Base)

    model



24
25
26
# File 'lib/otp/jwt/active_record.rb', line 24

def to_jwt
  OTP::JWT::Token.sign(sub: self.id)
end