Class: Auth::Middleware
- Inherits:
-
Rack::Auth::AbstractHandler
- Object
- Rack::Auth::AbstractHandler
- Auth::Middleware
- Defined in:
- lib/auth/middleware.rb
Defined Under Namespace
Classes: Request
Instance Method Summary collapse
Instance Method Details
#call(env) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/auth/middleware.rb', line 10 def call(env) auth = Request.new(env) return unless auth.provided? return bad_request unless auth.bearer? if valid?(auth) env['REMOTE_USER'] = auth.account_id return @app.call(env) end end |