Class: F4w::Rack::Oauth2

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

Overview

Validates oauth token

Instance Method Summary collapse

Instance Method Details

#call(env) ⇒ Object



16
17
18
19
20
21
22
23
24
25
# File 'lib/f4w/rack/oauth2.rb', line 16

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