Module: AuthlogicOauth::Session::Methods

Includes:
OauthProcess
Defined in:
lib/authlogic_oauth/session.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from OauthProcess

#generate_access_token

Class Method Details

.included(klass) ⇒ Object



24
25
26
27
28
# File 'lib/authlogic_oauth/session.rb', line 24

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.



31
32
33
34
35
36
# File 'lib/authlogic_oauth/session.rb', line 31

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



38
39
40
# File 'lib/authlogic_oauth/session.rb', line 38

def record=(record)
  @record = record
end

#save(&block) ⇒ Object

Clears out the block if we are authenticating with oauth, so that we can redirect without a DoubleRender error.



44
45
46
47
# File 'lib/authlogic_oauth/session.rb', line 44

def save(&block)
  block = nil if redirecting_to_oauth_server?
  super(&block)
end