diff options
author | Patrick J Cherry <patrick@bytemark.co.uk> | 2012-03-22 17:40:38 +0000 |
---|---|---|
committer | Patrick J Cherry <patrick@bytemark.co.uk> | 2012-03-22 17:40:38 +0000 |
commit | dc443284c4b5f59a4447797f88730d9fe1bc0b45 (patch) | |
tree | 1f82d0e9754c3239cc4ac65220ef4f54a4a5e44e /lib/mauve/authentication.rb | |
parent | 2622cd5d2cb322b78229d345d82076a582925ae2 (diff) |
Tidied up login authentication + tests (woo!)
Diffstat (limited to 'lib/mauve/authentication.rb')
-rw-r--r-- | lib/mauve/authentication.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/mauve/authentication.rb b/lib/mauve/authentication.rb index d0d4596..54743f1 100644 --- a/lib/mauve/authentication.rb +++ b/lib/mauve/authentication.rb @@ -139,7 +139,7 @@ module Mauve client.login(login, response) return true rescue XMLRPC::FaultException => fault - logger.warn "Authentication for #{login} failed: #{fault.faultCode}: #{fault.faultString}" + logger.warn "#{self.class} for #{login} failed: #{fault.faultCode}: #{fault.faultString}" return false rescue IOError => ex logger.warn "#{ex.class} during auth for #{login} (#{ex.to_s})" @@ -164,7 +164,12 @@ module Mauve # @return [Boolean] def authenticate(login,password) super - Digest::SHA1.hexdigest(password) == Mauve::Configuration.current.people[login].password + if ( Digest::SHA1.hexdigest(password) == Mauve::Configuration.current.people[login].password ) + return true + else + logger.warn "#{self.class} for #{login} failed" + return false + end end end |