mirror of
https://github.com/ENSL/ensl.org.git
synced 2025-01-12 21:00:58 +00:00
Fix user hash error
This commit is contained in:
parent
8326a49ccb
commit
8e389ff824
1 changed files with 7 additions and 1 deletions
|
@ -467,7 +467,13 @@ class User < ActiveRecord::Base
|
|||
case user.password_hash
|
||||
when User::PASSWORD_SCRYPT
|
||||
# FIXME: If exception occurs here, user cannot log in
|
||||
pass = SCrypt::Password.new(user.password)
|
||||
begin
|
||||
pass = SCrypt::Password.new(user.password)
|
||||
rescue
|
||||
logger.error "User (%s) password hash is invalid."
|
||||
flash[:error] = "Password hash is invalid, please use forget password functionality or contact admin."
|
||||
return nil
|
||||
end
|
||||
return user if pass == login[:password]
|
||||
when User::PASSWORD_MD5_SCRYPT
|
||||
pass = SCrypt::Password.new(user.password)
|
||||
|
|
Loading…
Reference in a new issue