lib/doorkeeper-jwt.rb in doorkeeper-jwt-0.1.0 vs lib/doorkeeper-jwt.rb in doorkeeper-jwt-0.1.1
- old
+ new
@@ -2,21 +2,21 @@
require "doorkeeper-jwt/config"
require 'jwt'
module Doorkeeper
module JWT
- def self.generate(resource_owner_id)
+ def self.generate(opts = {})
::JWT.encode(
- token_payload(resource_owner_id),
+ token_payload(opts),
secret_key,
encryption_method
)
end
private
- def self.token_payload(resource_owner_id)
- Doorkeeper::JWT.configuration.token_payload.call resource_owner_id
+ def self.token_payload(opts = {})
+ Doorkeeper::JWT.configuration.token_payload.call opts
end
def self.secret_key
secret_key_file || Doorkeeper::JWT.configuration.secret_key
end