Permalink
Browse files

rescue exceptions

  • Loading branch information...
1 parent 0f2b418 commit b94ee9da98b16e4c8fbdc91af8605669d01b17e6 @jinzhu committed Feb 23, 2012
Showing with 2 additions and 0 deletions.
  1. +2 −0 lib/devise/models/database_authenticatable.rb
@@ -37,6 +37,8 @@ def valid_password?(password)
bcrypt = ::BCrypt::Password.new(self.encrypted_password)
password = ::BCrypt::Engine.hash_secret("#{password}#{self.class.pepper}", bcrypt.salt)
Devise.secure_compare(password, self.encrypted_password)
+ rescue
+ false
end
# Set password and password confirmation to nil

0 comments on commit b94ee9d

Please sign in to comment.