Class: Warden::JWTAuth::Middleware::RevocationManager
- Inherits:
-
Warden::JWTAuth::Middleware
- Object
- Warden::JWTAuth::Middleware
- Warden::JWTAuth::Middleware::RevocationManager
- 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
-
#app ⇒ Object
readonly
Returns the value of attribute app.
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#helper ⇒ Object
readonly
Returns the value of attribute helper.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ RevocationManager
constructor
A new instance of RevocationManager.
Constructor Details
#initialize(app) ⇒ RevocationManager
Returns a new instance of RevocationManager.
13 14 15 16 17 |
# File 'lib/warden/jwt_auth/middleware/revocation_manager.rb', line 13 def initialize(app) @app = app @config = JWTAuth.config @helper = EnvHelper end |
Instance Attribute Details
#app ⇒ Object (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 |
#config ⇒ Object (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 |
#helper ⇒ Object (readonly)
Returns the value of attribute helper.
11 12 13 |
# File 'lib/warden/jwt_auth/middleware/revocation_manager.rb', line 11 def helper @helper end |
Instance Method Details
#call(env) ⇒ Object
19 20 21 22 23 24 |
# File 'lib/warden/jwt_auth/middleware/revocation_manager.rb', line 19 def call(env) env[ENV_KEY] = true response = app.call(env) revoke_token(env) response end |