lib/certmeister/policy/chain_any.rb in certmeister-0.4.0 vs lib/certmeister/policy/chain_any.rb in certmeister-0.4.1
- old
+ new
@@ -10,14 +10,13 @@
Certmeister::Policy.validate_policies(policies)
@policies = policies
end
def authenticate(request)
- failure = Certmeister::Policy::Response.new(false, "no conditions satisifed")
- @policies.inject(failure) do |continue, policy|
+ @policies.inject(nil) do |continue, policy|
response = policy.authenticate(request)
break response if response.authenticated?
- continue
+ continue or response
end
end
end