Sha256: 4c8cbb0dac59d83b8324d41edad4847c44c83c9a1982c5a64695b7183aba91a3

Contents?: true

Size: 573 Bytes

Versions: 11

Compression:

Stored size: 573 Bytes

Contents

module Vidibus
  module User
    class CallbackApp
      def self.call(env)
        self.new.call(env)
      end

      # This is just a rack endpoint for Connector authentication. It will be called
      # by the Connector after requesting an authentication code.
      def call(env)
        env["warden"].authenticate!(:scope => :user)

        # Redirect to return path after signin
        return_to = env["rack.session"][:user_return_to] || "/"
        [302, {"Content-Type" => "text/html", "Location" => return_to}, ["Login successful."]]
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
vidibus-user-0.0.10 lib/vidibus/user/callback_app.rb
vidibus-user-0.0.9 lib/vidibus/user/callback_app.rb
vidibus-user-0.0.8 lib/vidibus/user/callback_app.rb
vidibus-user-0.0.7 lib/vidibus/user/callback_app.rb
vidibus-user-0.0.6 lib/vidibus/user/callback_app.rb
vidibus-user-0.0.5 lib/vidibus/user/callback_app.rb
vidibus-user-0.0.4 lib/vidibus/user/callback_app.rb
vidibus-user-0.0.3 lib/vidibus/user/callback_app.rb
vidibus-user-0.0.2 lib/vidibus/user/callback_app.rb
vidibus-user-0.0.1 lib/vidibus/user/callback_app.rb
vidibus-user-0.0.0 lib/vidibus/user/callback_app.rb