Module: AuthlogicOpenid::Session::Methods
- Defined in:
- lib/authlogic_openid/session.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#credentials=(value) ⇒ Object
Hooks into credentials so that you can pass an :openid_identifier key.
- #openid_identifier=(value) ⇒ Object
-
#save(&block) ⇒ Object
Cleaers out the block if we are authenticating with OpenID, so that we can redirect without a DoubleRender error.
Class Method Details
.included(klass) ⇒ Object
45 46 47 48 49 50 51 |
# File 'lib/authlogic_openid/session.rb', line 45 def self.included(klass) klass.class_eval do attr_reader :openid_identifier validate :validate_openid_error validate :validate_by_openid, :if => :authenticating_with_openid? end end |
Instance Method Details
#credentials=(value) ⇒ Object
Hooks into credentials so that you can pass an :openid_identifier key.
54 55 56 57 58 59 |
# File 'lib/authlogic_openid/session.rb', line 54 def credentials=(value) super values = value.is_a?(Array) ? value : [value] hash = values.first.is_a?(Hash) ? values.first.with_indifferent_access : nil self.openid_identifier = hash[:openid_identifier] if !hash.nil? && hash.key?(:openid_identifier) end |
#openid_identifier=(value) ⇒ Object
61 62 63 64 65 66 67 |
# File 'lib/authlogic_openid/session.rb', line 61 def openid_identifier=(value) @openid_identifier = value.blank? ? nil : OpenID.normalize_url(value) @openid_error = nil rescue OpenID::DiscoveryFailure => e @openid_identifier = nil @openid_error = e. end |
#save(&block) ⇒ Object
Cleaers out the block if we are authenticating with OpenID, so that we can redirect without a DoubleRender error.
71 72 73 74 |
# File 'lib/authlogic_openid/session.rb', line 71 def save(&block) block = nil if !openid_identifier.blank? && controller.request.env[Rack::OpenID::RESPONSE].blank? super(&block) end |