lib/janus/strategies.rb in janus-0.6.0 vs lib/janus/strategies.rb in janus-0.7.0
- old
+ new
@@ -8,19 +8,19 @@
end
# Runs a given strategy and returns true if it succeeded.
def run_strategy(name, scope)
strategy = "Janus::Strategies::#{name.to_s.camelize}".constantize.new(scope, self)
-
+
if strategy.valid?
strategy.authenticate!
-
+
if strategy.success?
send(strategy.auth_method, strategy.user, :scope => scope)
Janus::Manager.run_callbacks(:authenticate, strategy.user, self, :scope => scope)
end
end
-
+
strategy.success?
end
module ClassMethods
# Returns the list of strategies as underscore symbols.