Sha256: c4a558b99ded9c34fc1e5c6dc0503f77b50915e4a2ee0986b63330330c2e8c3b

Contents?: true

Size: 724 Bytes

Versions: 2

Compression:

Stored size: 724 Bytes

Contents

module Vidibus
  module User
    module Warden
      class FailureApp
        include Warden::Helper

        def self.call(env)
          self.new.call(env)
        end

        # This is a rack endpoint user authentication. It will be called
        # by the consumer after requesting an authentication code.
        def call(env)
          @env = env
          body = "Please authenticate at #{host}#{Vidibus::User.login_path}"
          header = {
            'Content-Type' => 'text/html',
            'Location' => Vidibus::User.login_path,
            'Content-Length' => body.length.to_s
          }
          [302, header, [body]]
        end

        def env
          @env
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
vidibus-user-1.0.1 lib/vidibus/user/warden/failure_app.rb
vidibus-user-1.0.0 lib/vidibus/user/warden/failure_app.rb