Module: AuthlogicConnect::Common::State
- Included in:
- Variables
- Defined in:
- lib/authlogic_connect/common/state.rb
Overview
This class holds query/state variables common to oauth and openid
Instance Method Summary collapse
- #auth_controller? ⇒ Boolean
- #auth_params? ⇒ Boolean
- #auth_session? ⇒ Boolean
-
#correct_request_class? ⇒ Boolean
because user and session are so closely tied together, I am still uncertain as to how they are saved.
- #is_auth_session? ⇒ Boolean
- #start_authentication? ⇒ Boolean
- #validate_password_with_oauth? ⇒ Boolean
- #validate_password_with_openid? ⇒ Boolean
Instance Method Details
#auth_controller? ⇒ Boolean
4 5 6 |
# File 'lib/authlogic_connect/common/state.rb', line 4 def auth_controller? !auth_controller.blank? end |
#auth_params? ⇒ Boolean
8 9 10 |
# File 'lib/authlogic_connect/common/state.rb', line 8 def auth_params? auth_controller? && !auth_params.blank? end |
#auth_session? ⇒ Boolean
12 13 14 |
# File 'lib/authlogic_connect/common/state.rb', line 12 def auth_session? !auth_session.blank? end |
#correct_request_class? ⇒ Boolean
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.
35 36 37 38 39 40 41 42 43 |
# File 'lib/authlogic_connect/common/state.rb', line 35 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 |
#is_auth_session? ⇒ Boolean
16 17 18 |
# File 'lib/authlogic_connect/common/state.rb', line 16 def is_auth_session? self.is_a?(Authlogic::Session::Base) end |
#start_authentication? ⇒ Boolean
20 21 22 |
# File 'lib/authlogic_connect/common/state.rb', line 20 def start_authentication? start_oauth? || start_openid? end |
#validate_password_with_oauth? ⇒ Boolean
24 25 26 |
# File 'lib/authlogic_connect/common/state.rb', line 24 def validate_password_with_oauth? !using_openid? && super end |
#validate_password_with_openid? ⇒ Boolean
28 29 30 |
# File 'lib/authlogic_connect/common/state.rb', line 28 def validate_password_with_openid? !using_oauth? && super end |