Sha256: f838519b2d8ba505693f0d67f122196797a1b7579cee34136f1679c80373c98d
Contents?: true
Size: 1.19 KB
Versions: 3
Compression:
Stored size: 1.19 KB
Contents
module AuthlogicConnect::Common module User def self.included(base) base.class_eval do add_acts_as_authentic_module(Variables, :prepend) add_acts_as_authentic_module(InstanceMethods, :append) end end module InstanceMethods def authenticated_with @authenticated_with ||= self.tokens.collect{|t| t.service_name.to_s} end def authenticated_with?(service) self.tokens.detect{|t| t.service_name.to_s == service.to_s} end # core save method coordinating how to save the user def save(perform_validation = true, &block) status = true if authenticating_with_openid? status = save_with_openid(perform_validation, &block) elsif authenticating_with_oauth? status = save_with_oauth(perform_validation, &block) end if status result = super(:validate => true) yield(result) if block_given? end result end def validate_password_with_oauth? !using_openid? && super end def validate_password_with_openid? !using_oauth? && super end end end end
Version data entries
3 entries across 3 versions & 1 rubygems