Class: Springcm::Middleware::AuthExpire
- Inherits:
-
Object
- Object
- Springcm::Middleware::AuthExpire
- Defined in:
- lib/springcm-sdk/middleware/auth_expired.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, options = {}) ⇒ AuthExpire
constructor
A new instance of AuthExpire.
Constructor Details
#initialize(app, options = {}) ⇒ AuthExpire
Returns a new instance of AuthExpire.
6 7 8 9 |
# File 'lib/springcm-sdk/middleware/auth_expired.rb', line 6 def initialize(app, ={}) @app = app @options = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
4 5 6 |
# File 'lib/springcm-sdk/middleware/auth_expired.rb', line 4 def @options end |
Instance Method Details
#call(env) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/springcm-sdk/middleware/auth_expired.rb', line 11 def call(env) @app.call(env).on_complete do |response_env| if response_env[:status] == 401 raise Springcm::AuthExpiredError.new end end end |