Major revamp of security. Passwords are first SHA1 hashed and then
that hash is bcrypted. Bcrypted hashes are stored in a new column on users. This separate column is only to allow for rollbacks, eventually the old SHA1 hash column will be removed. Sensitive cookie details are now encrypted to prevent user tampering and more stringent checks on secret_token and session_secret_key are enforced.
This commit is contained in:
@@ -32,7 +32,7 @@ private
|
||||
end
|
||||
|
||||
def load_cookie_user
|
||||
CurrentUser.user = User.find_by_name(cookies[:user_name])
|
||||
CurrentUser.user = User.find_by_name(cookies.signed[:user_name])
|
||||
CurrentUser.ip_addr = request.remote_ip
|
||||
end
|
||||
|
||||
@@ -41,7 +41,7 @@ private
|
||||
end
|
||||
|
||||
def cookie_password_hash_valid?
|
||||
cookies[:cookie_password_hash] && User.authenticate_cookie_hash(cookies[:user_name], cookies[:cookie_password_hash])
|
||||
cookies[:password_hash] && User.authenticate_cookie_hash(cookies.signed[:user_name], cookies.signed[:password_hash])
|
||||
end
|
||||
|
||||
def update_last_logged_in_at
|
||||
|
||||
Reference in New Issue
Block a user