class Facemock::OAuth::LoginHook

Constants

DEFAULT_PATH

Attributes

paths[RW]

Public Instance Methods

call(env) click to toggle source
Calls superclass method
# File lib/facemock/oauth/login_hook.rb, line 11
def call(env)
  res = super
  if LoginHook.paths.include?(env["PATH_INFO"])
    code   = 302
    body   = []
    header = { "Content-Type"           => "text/html;charset=utf-8",
               "Location"               => location(env, "/facemock/sign_in"),
               "Content-Length"         => content_length(body).to_s,
               "X-XSS-Protection"       => "1; mode=block",
               "X-Content-Type-Options" => "nosniff",
               "X-Frame-Options"        => "SAMEORIGIN" }
    res = [ code, header, body ]
  end
  res
end