lib/opro.rb in opro-0.4.0 vs lib/opro.rb in opro-0.4.1
- old
+ new
@@ -44,17 +44,17 @@
end
end
# Used by application controller to log user in
def self.login(*args)
- raise 'login method not set, please specify Opro auth_strategy' if login_method.blank?
+ raise 'login method not set; please specify an oPRO auth_strategy in config/initializers/opro.rb' if login_method.blank?
login_method.call(*args)
end
# Used by application controller to log user out
def self.logout(*args)
- raise 'login method not set, please specify Opro auth_strategy' if login_method.blank?
+ raise 'logout method not set; please specify an oPRO auth_strategy in config/initializers/opro.rb' if login_method.blank?
logout_method.call(*args)
end
# Used by set_login_logout_methods to pre-define login, logout, and authenticate methods
def self.auth_strategy(auth_strategy = nil)
@@ -72,11 +72,11 @@
def self.login_method(&block)
if block.present?
@login_method = block
else
- @login_method or raise 'login method not set, please specify Opro auth_strategy'
+ @login_method or raise 'login method not set; please specify an oPRO auth_strategy in config/initializers/opro.rb'
end
end
def self.request_permissions=(permissions)
@request_permissions = permissions
@@ -96,19 +96,19 @@
def self.logout_method(&block)
if block.present?
@logout_method = block
else
- @logout_method or raise 'login method not set, please specify Opro auth_strategy'
+ @logout_method or raise 'logout method not set; please specify an oPRO auth_strategy in config/initializers/opro.rb'
end
end
def self.authenticate_user_method(&block)
if block.present?
@authenticate_user_method = block
else
- @authenticate_user_method or raise 'authenticate_user_method not set, please specify Opro auth_strategy'
+ @authenticate_user_method or raise 'authenticate_user_method not set, please specify an oPRO auth_strategy in config/initializers/opro.rb'
end
end
# calls all of the different auths made available,
def self.find_user_for_all_auths!(controller, params)
@@ -145,10 +145,10 @@
def self.find_user_for_auth(&block)
if block.present?
@find_for_authentication ||= []
@find_for_authentication << convert_to_lambda(&block)
else
- @find_for_authentication or raise 'find_for_authentication not set, please specify Opro auth_strategy'
+ @find_for_authentication or raise 'find_for_authentication not set, please specify an oPRO auth_strategy in config/initializers/opro.rb'
end
end
def self.password_exchange_enabled=(password_exchange_enabled)
@password_exchange_enabled = password_exchange_enabled