Sha256: 3acbc1c6ae16e533738ab01de99b00073701a6a77f9e5b2ee764e3252f3bf7d6

Contents?: true

Size: 981 Bytes

Versions: 10

Compression:

Stored size: 981 Bytes

Contents

# This class holds query/state variables common to oauth and openid
module AuthlogicConnect::Common::State
  
  def auth_controller?
    !auth_controller.blank?
  end

  def auth_params?
    auth_controller? && !auth_params.blank?
  end
  
  def auth_session?
    !auth_session.blank?
  end
  
  def is_auth_session?
    self.is_a?(Authlogic::Session::Base)
  end
  
  def start_authentication?
    start_oauth? || start_openid?
  end
  
  def validate_password_with_oauth?
    !using_openid? && super
  end
  
  def validate_password_with_openid?
    !using_oauth? && super
  end
  
  # because user and session are so closely tied together, I am still
  # uncertain as to how they are saved.  So this makes sure if we are
  # logging in, it must be saving the session, otherwise the user.
  def correct_request_class?
    return false unless auth_params?
    
    if is_auth_session?
      auth_type.to_s == "session"
    else
      auth_type.to_s == "user"
    end
  end
  
end

Version data entries

10 entries across 10 versions & 5 rubygems

Version Path
robdimarco-authlogic-connect-0.0.6 lib/authlogic_connect/common/state.rb
anideo-authlogic-connect-0.0.6 lib/authlogic_connect/common/state.rb
jspooner-authlogic-connect-0.0.20 lib/authlogic_connect/common/state.rb
jspooner-authlogic-connect-0.0.19 lib/authlogic_connect/common/state.rb
foreverman-authlogic-connect-0.0.4 lib/authlogic_connect/common/state.rb
foreverman-authlogic-connect-0.0.3 lib/authlogic_connect/common/state.rb
foreverman-authlogic-connect-0.0.2 lib/authlogic_connect/common/state.rb
foreverman-authlogic-connect-0.0.1 lib/authlogic_connect/common/state.rb
foreverman-authlogic-connect-0.0.6 lib/authlogic_connect/common/state.rb
authlogic-connect-0.0.6 lib/authlogic_connect/common/state.rb