From 0b0aa77834a921566d3b99586b94013b470b5da6 Mon Sep 17 00:00:00 2001 From: telyn Date: Thu, 5 Jan 2017 16:25:23 +0000 Subject: ensure Mauve::Authentication.authenticate does what we think it does --- lib/mauve/authentication.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/mauve/authentication.rb b/lib/mauve/authentication.rb index 73c503a..d03178a 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 @@ -73,7 +71,7 @@ module Mauve sleep Configuration.current.failed_login_delay end - result + auth_success end end -- cgit v1.2.1 From 9101dcd98398dcf1c92138d8ae037c5bbe7ba990 Mon Sep 17 00:00:00 2001 From: telyn Date: Fri, 6 Jan 2017 11:17:50 +0000 Subject: Mauve::Authentication - fix my previous commit --- lib/mauve/authentication.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mauve/authentication.rb b/lib/mauve/authentication.rb index d03178a..08e0bf0 100644 --- a/lib/mauve/authentication.rb +++ b/lib/mauve/authentication.rb @@ -65,7 +65,7 @@ module Mauve result end - unless true == result + unless auth_success logger.info "Authentication for #{login} failed" # Rate limit sleep Configuration.current.failed_login_delay -- cgit v1.2.1