Sha256: fc134671313e2d89d612c4eb57bda1988d9363af6675cec88d771c4aecaa0747

Contents?: true

Size: 777 Bytes

Versions: 4

Compression:

Stored size: 777 Bytes

Contents

module Facemock
  module OAuth
    class LoginHook < RackMiddleware
      DEFAULT_PATH = "/sign_in"
      @path = DEFAULT_PATH

      def call(env)
        res = super
        if env["PATH_INFO"] == LoginHook.path
          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
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
facemock-oauth-0.0.4 lib/facemock/oauth/login_hook.rb
facemock-oauth-0.0.3 lib/facemock/oauth/login_hook.rb
facemock-oauth-0.0.2 lib/facemock/oauth/login_hook.rb
facemock-oauth-0.0.1 lib/facemock/oauth/login_hook.rb