Module: Doorkeeper::JWT

Defined in:
lib/doorkeeper-jwt.rb,
lib/doorkeeper-jwt/config.rb,
lib/doorkeeper-jwt/version.rb

Defined Under Namespace

Classes: Config, MissingConfiguration

Constant Summary collapse

VERSION =
"0.1.7".freeze

Class Method Summary collapse

Class Method Details

.configurationObject



13
14
15
# File 'lib/doorkeeper-jwt/config.rb', line 13

def self.configuration
  @config || (fail MissingConfiguration.new)
end

.configure(&block) ⇒ Object



9
10
11
# File 'lib/doorkeeper-jwt/config.rb', line 9

def self.configure(&block)
  @config = Config::Builder.new(&block).build
end

.generate(opts = {}) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/doorkeeper-jwt.rb', line 8

def generate(opts = {})
  ::JWT.encode(
    token_payload(opts),
    secret_key(opts),
    encryption_method
  )
end