Merge branch 'master' of github.com:OWASP/railsgoat into top-10-2013

This commit is contained in:
cktricky
2013-08-08 16:59:14 -04:00
2 changed files with 5 additions and 5 deletions
@@ -42,7 +42,7 @@
Within app/models/user.rb:
</p>
<pre class="ruby">
before_save <span style="background-color:yellow">:encrypt_password</span>
before_save <span style="background-color:yellow">:hash_password</span>
def self.authenticate(email, password)
auth = nil
@@ -59,7 +59,7 @@
return auth
end
def encrypt_password
def hash_password
if self.password.present?
self.password = <span style="background-color:yellow">Digest::MD5.hexdigest(password)</span>
end
@@ -98,7 +98,7 @@
end
end
def encrypt_password
def hash_password
if self.password.present?
<span style="background-color:yellow">self.password_salt = BCrypt::Engine.generate_salt</span>
<span style="background-color:yellow">self.password_hash = BCrypt::Engine.hash_secret(self.password, self.password_salt)</span>