aboutsummaryrefslogtreecommitdiff
path: root/lib/mauve/authentication.rb
diff options
context:
space:
mode:
authorPatrick J Cherry <patrick@bytemark.co.uk>2012-03-22 17:40:38 +0000
committerPatrick J Cherry <patrick@bytemark.co.uk>2012-03-22 17:40:38 +0000
commitdc443284c4b5f59a4447797f88730d9fe1bc0b45 (patch)
tree1f82d0e9754c3239cc4ac65220ef4f54a4a5e44e /lib/mauve/authentication.rb
parent2622cd5d2cb322b78229d345d82076a582925ae2 (diff)
Tidied up login authentication + tests (woo!)
Diffstat (limited to 'lib/mauve/authentication.rb')
-rw-r--r--lib/mauve/authentication.rb9
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