Module: Keyper::ApiKeyAuthentication

Extended by:
ActiveSupport::Concern
Included in:
ApiKeysController
Defined in:
app/controllers/concerns/keyper/api_key_authentication.rb

Constant Summary collapse

API_KEY =
'Api-Key'
API_SECRET =
'Api-Secret'

Instance Method Summary collapse

Instance Method Details

#current_userObject

Override the default current_user functionality



10
11
12
13
14
15
16
17
# File 'app/controllers/concerns/keyper/api_key_authentication.rb', line 10

def current_user
  return @current_user if defined?(@current_user)
  @current_user = if passed_api_keys?
                    authenticate_with_api_keys
                  elsif current_user_session && current_user_session.record
                    current_user_session.record
                  end
end