only store partial hash in cookies for validation
This commit is contained in:
@@ -16,7 +16,7 @@ class SessionCreator
|
||||
|
||||
if remember.present?
|
||||
cookies.permanent.signed[:user_name] = user.name
|
||||
cookies.permanent.signed[:password_hash] = user.bcrypt_password_hash
|
||||
cookies.permanent[:password_hash] = user.bcrypt_cookie_password_hash
|
||||
end
|
||||
|
||||
session[:user_id] = user.id
|
||||
|
||||
@@ -41,7 +41,7 @@ private
|
||||
end
|
||||
|
||||
def cookie_password_hash_valid?
|
||||
cookies[:password_hash] && User.authenticate_cookie_hash(cookies.signed[:user_name], cookies.signed[:password_hash])
|
||||
cookies[:password_hash] && User.authenticate_cookie_hash(cookies.signed[:user_name], cookies[:password_hash])
|
||||
end
|
||||
|
||||
def update_last_logged_in_at
|
||||
|
||||
Reference in New Issue
Block a user