Sha256: 1492651e245718033f30c6fd24d80db1ef0aca6b2f96b994783a1c7c7861a811

Contents?: true

Size: 623 Bytes

Versions: 20

Compression:

Stored size: 623 Bytes

Contents

require "active_support/hash_with_indifferent_access"

module Rails
  module Auth
    # Convenience methods designed to be included in an ActionController::Base subclass
    # Recommended use: include in ApplicationController
    module ControllerMethods
      # Obtain credentials for the current request
      #
      # @return [HashWithIndifferentAccess] credentials extracted from the environment
      #
      def credentials
        @_rails_auth_credentials ||= begin
          creds = Rails::Auth.credentials(request.env)
          HashWithIndifferentAccess.new(creds).freeze
        end
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
rails-auth-2.1.4 lib/rails/auth/controller_methods.rb
rails-auth-2.1.3 lib/rails/auth/controller_methods.rb
rails-auth-2.1.2 lib/rails/auth/controller_methods.rb
rails-auth-2.1.1 lib/rails/auth/controller_methods.rb
rails-auth-2.1.0 lib/rails/auth/controller_methods.rb
rails-auth-2.0.3 lib/rails/auth/controller_methods.rb
rails-auth-2.0.2 lib/rails/auth/controller_methods.rb
rails-auth-2.0.1 lib/rails/auth/controller_methods.rb
rails-auth-1.3.0 lib/rails/auth/controller_methods.rb
rails-auth-1.2.0 lib/rails/auth/controller_methods.rb
rails-auth-1.1.0 lib/rails/auth/controller_methods.rb
rails-auth-1.0.0 lib/rails/auth/controller_methods.rb
rails-auth-0.5.3 lib/rails/auth/controller_methods.rb
rails-auth-0.5.2 lib/rails/auth/controller_methods.rb
rails-auth-0.5.1 lib/rails/auth/controller_methods.rb
rails-auth-0.5.0 lib/rails/auth/controller_methods.rb
rails-auth-0.4.1 lib/rails/auth/controller_methods.rb
rails-auth-0.4.0 lib/rails/auth/controller_methods.rb
rails-auth-0.3.0 lib/rails/auth/controller_methods.rb
rails-auth-0.2.0 lib/rails/auth/controller_methods.rb