app/models/user.rb in radiant-0.6.9 vs app/models/user.rb in radiant-0.7.0
- old
+ new
@@ -32,10 +32,14 @@
Digest::SHA1.hexdigest("--#{salt}--#{phrase}--")
end
def self.authenticate(login, password)
user = find_by_login(login)
- user if user && user.password == user.sha1(password)
+ user if user && user.authenticated?(password)
+ end
+
+ def authenticated?(password)
+ self.password == sha1(password)
end
def after_initialize
@confirm_password = true
end