Module: AuthlogicConnect::Oauth::Session::InstanceMethods

Includes:
Process
Defined in:
lib/authlogic_connect/oauth/session.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Variables

#oauth_consumer, #oauth_key, #oauth_provider, #oauth_response, #oauth_token, #oauth_version

Class Method Details

.included(klass) ⇒ Object



14
15
16
17
18
# File 'lib/authlogic_connect/oauth/session.rb', line 14

def self.included(klass)
  klass.class_eval do
    validate :validate_by_oauth, :if => :authenticating_with_oauth?
  end
end

Instance Method Details

#credentials=(value) ⇒ Object

Hooks into credentials so that you can pass a user who has already has an oauth access token.



21
22
23
24
25
26
# File 'lib/authlogic_connect/oauth/session.rb', line 21

def credentials=(value)
  super
  values = value.is_a?(Array) ? value : [value]
  hash = values.first.is_a?(Hash) ? values.first.with_indifferent_access : nil
  self.record = hash[:priority_record] if !hash.nil? && hash.key?(:priority_record)
end

#record=(record) ⇒ Object



28
29
30
# File 'lib/authlogic_connect/oauth/session.rb', line 28

def record=(record)
  @record = record
end