Class: RackJWTDecode

Inherits:
Object
  • Object
show all
Defined in:
lib/rack_jwt_decode.rb

Constant Summary collapse

HTTP_AUTHORIZATION =
"HTTP_AUTHORIZATION".freeze
BEARER_REGEXP =
/\ABearer /i.freeze

Instance Method Summary collapse

Constructor Details

#initialize(app, application_secret) ⇒ RackJWTDecode

Returns a new instance of RackJWTDecode.



7
8
9
10
# File 'lib/rack_jwt_decode.rb', line 7

def initialize(app, application_secret)
  @app = app
  @application_secret = application_secret
end

Instance Method Details

#call(env) ⇒ Object



12
13
14
15
# File 'lib/rack_jwt_decode.rb', line 12

def call(env)
  add_jwt_payload_to_env(env)
  @app.call(env)
end