Class: Warden::JWTAuth::Middleware::RevocationManager

Inherits:
Warden::JWTAuth::Middleware show all
Defined in:
lib/warden/jwt_auth/middleware/revocation_manager.rb

Overview

Revokes a token if it path and method match with configured

Constant Summary collapse

ENV_KEY =

Debugging key added to ‘env`

'warden-jwt_auth.revocation_manager'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ RevocationManager

Returns a new instance of RevocationManager.



13
14
15
16
# File 'lib/warden/jwt_auth/middleware/revocation_manager.rb', line 13

def initialize(app)
  @app = app
  @config = JWTAuth.config
end

Instance Attribute Details

#appObject (readonly)

Returns the value of attribute app.



11
12
13
# File 'lib/warden/jwt_auth/middleware/revocation_manager.rb', line 11

def app
  @app
end

#configObject (readonly)

Returns the value of attribute config.



11
12
13
# File 'lib/warden/jwt_auth/middleware/revocation_manager.rb', line 11

def config
  @config
end

Instance Method Details

#call(env) ⇒ Object



18
19
20
21
22
23
# File 'lib/warden/jwt_auth/middleware/revocation_manager.rb', line 18

def call(env)
  env[ENV_KEY] = true
  response = app.call(env)
  revoke_token(env)
  response
end