Module: AuthlogicRpx::Session::Methods

Defined in:
lib/authlogic_rpx/session.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(klass) ⇒ Object



61
62
63
64
65
66
67
68
# File 'lib/authlogic_rpx/session.rb', line 61

def self.included(klass)
  klass.class_eval do
    attr_accessor :new_registration
    after_persisting :add_rpx_identifier, :if => :adding_rpx_identifier?
    validate :validate_by_rpx, :if => :authenticating_with_rpx?
    validate :validate_user
  end
end

Instance Method Details

#new_registration?Boolean

Determines if the authenticated user is also a new registration. For use in the session controller to help direct the most appropriate action to follow.

Returns:

  • (Boolean)


73
74
75
# File 'lib/authlogic_rpx/session.rb', line 73

def new_registration?
  new_registration || !new_registration.nil?
end

#registration_complete?Boolean

Determines if the authenticated user has a complete registration (no validation errors) For use in the session controller to help direct the most appropriate action to follow.

Returns:

  • (Boolean)


87
88
89
# File 'lib/authlogic_rpx/session.rb', line 87

def registration_complete?
  attempted_record && attempted_record.valid?
end

#registration_incomplete?Boolean

True if the login was succeessful, but the logged-in user object is invalid. For use in the session controller to help direct the most appropriate action to follow.

Returns:

  • (Boolean)


80
81
82
# File 'lib/authlogic_rpx/session.rb', line 80

def registration_incomplete?
  valid? && attempted_record && !attempted_record.valid?
end