diff options
author | James Carter <james.carter@bytemark.co.uk> | 2017-01-06 11:31:28 +0000 |
---|---|---|
committer | James Carter <james.carter@bytemark.co.uk> | 2017-01-06 11:31:28 +0000 |
commit | 0be1fa0ebadf9435a760582d17f47ff96dc0851c (patch) | |
tree | 8294e58550b0accd7f90b717191452b22a98675e | |
parent | 5c62ccc2858f8f8245cb6e8f7058c58de9363419 (diff) | |
parent | 9101dcd98398dcf1c92138d8ae037c5bbe7ba990 (diff) |
Merge branch 'auth-tidy' into 'master'
ensure Mauve::Authentication.authenticate does what we think it does
Closes #24
See merge request !1
-rw-r--r-- | lib/mauve/authentication.rb | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/mauve/authentication.rb b/lib/mauve/authentication.rb index 73c503a..08e0bf0 100644 --- a/lib/mauve/authentication.rb +++ b/lib/mauve/authentication.rb @@ -49,9 +49,7 @@ module Mauve # @return [Boolean] Success or failure. # def self.authenticate(login, password) - result = false - - ORDER.any? do |klass| + auth_success = ORDER.any? do |klass| auth = klass.new result = begin @@ -67,13 +65,13 @@ module Mauve result end - unless true == result + unless auth_success logger.info "Authentication for #{login} failed" # Rate limit sleep Configuration.current.failed_login_delay end - result + auth_success end end |