lib/self-auth-rails.rb in self-auth-rails-0.1.2 vs lib/self-auth-rails.rb in self-auth-rails-0.1.3
- old
+ new
@@ -6,20 +6,24 @@
:session_class_name,
:auth_facts,
:fact_mapping,
:authenticated_path,
:authenticated_path,
- :layout
+ :layout,
+ :permitted_auth
class Engine < ::Rails::Engine
default_auth_facts = [:display_name]
default_authenticated_path = '/'
config.after_initialize do
unless SelfAuthRails::self_client.nil?
SelfAuthRails.auth_facts ||= default_auth_facts
SelfAuthRails.authenticated_path ||= default_authenticated_path
+ if SelfAuthRails.permitted_auth.nil?
+ SelfAuthRails.permitted_auth ||= Proc.new { |selfid| true }
+ end
response_manager = SelfAuthResponseManagerService.new(ActionCable.server)
# Subscribe to fact responses
SelfAuthRails::self_client.facts.subscribe do |auth|
@@ -40,12 +44,8 @@
end
# this function maps the vars from your app into your engine
def self.setup(&block)
yield self
- end
-
- def authenticated_path
- SelfAuthRails::authenticated_path || SelfAuthRails::default_authenticated_path
end
end