Class: F4w::Rack::MockOauth2

Inherits:
Object
  • Object
show all
Defined in:
lib/f4w/rack/mock_oauth2.rb

Overview

A Mock that behaves like F4w::Rack::Oauth2

Instance Method Summary collapse

Instance Method Details

#call(env) ⇒ Object



14
15
16
17
18
19
20
21
22
23
# File 'lib/f4w/rack/mock_oauth2.rb', line 14

def call(env)
  req = ::Rack::Request.new(env)
  if req.params['access_token']
    validate_token(req, env)
  else
    env['rack.oauth2.valid_token'] = false
  end

  @app.call(env)
end