Module: Rails::Auth::ControllerMethods

Defined in:
lib/rails/auth/controller_methods.rb

Overview

Convenience methods designed to be included in an ActionController::Base subclass Recommended use: include in ApplicationController

Instance Method Summary collapse

Instance Method Details

#credentialsHashWithIndifferentAccess

Obtain credentials for the current request

Returns:

  • (HashWithIndifferentAccess)

    credentials extracted from the environment



15
16
17
18
19
20
# File 'lib/rails/auth/controller_methods.rb', line 15

def credentials
  @_rails_auth_credentials ||= begin
    creds = Rails::Auth.credentials(request.env)
    HashWithIndifferentAccess.new(creds).freeze
  end
end