Class: Tep::AuthFilter

Inherits:
Filter
  • Object
show all
Defined in:
lib/tep/auth.rb

Overview

The before-filter that runs the provider chain and writes the result to req.identity. Lives at top level (not Tep::Auth::Filter) to keep dispatch simple under spinel.

Instance Method Summary collapse

Methods inherited from Filter

#after

Instance Method Details

#before(req, res) ⇒ Object



68
69
70
71
72
73
74
75
76
# File 'lib/tep/auth.rb', line 68

def before(req, res)
  ident = Tep::Auth.identify(req)
  if ident == nil
    req.identity = Tep::Identity.anonymous
  else
    req.identity = ident
  end
  0
end