module AuthlogicOauth::Session::Methods

Public Class Methods

included(klass) click to toggle source
# 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

Public Instance Methods

credentials=(value) click to toggle source

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

# 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) click to toggle source
# File lib/authlogic_oauth/session.rb, line 38
def record=(record)
  @record = record
end
save(&block) click to toggle source

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

# File lib/authlogic_oauth/session.rb, line 44
def save(&block)
  block = nil if redirecting_to_oauth_server?
  super(&block)
end