Sha256: ace8398403d0051d85e240cb5e402944c756b63ab5c5dd979daf21beff1b34e1

Contents?: true

Size: 800 Bytes

Versions: 3

Compression:

Stored size: 800 Bytes

Contents

module DoorkeeperSsoClient
  module Warden
    module Support
      extend ActiveSupport::Concern
      include ::DoorkeeperSsoClient::Logging

      included do
        attr_reader :user, :warden, :options
        delegate :request, to: :warden
        delegate :params, to: :request
      end

      module ClassMethods
        def to_proc
          proc do |user, warden, options|
            new(user, warden, options).call
          end
        end
      end

      def initialize(user, warden, options)
        @user, @warden, @options = user, warden, options
      end

      def scope
        scope = options[:scope]
      end

      def session
        warden.session(scope)
      end

      def logged_in?
        warden.authenticated?(scope) && session && user
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
doorkeeper_sso_client-0.4.10 lib/doorkeeper_sso_client/warden/support.rb
doorkeeper_sso_client-0.4.7 lib/doorkeeper_sso_client/warden/support.rb
doorkeeper_sso_client-0.4.6 lib/doorkeeper_sso_client/warden/support.rb