sessions: remove legacy user_name / password_hash cookies.
Remove support for logging in with the deprecated user_name /
password_hash cookies. Followup to 320ff01e0.
This commit is contained in:
@@ -165,10 +165,6 @@ class User < ApplicationRecord
|
||||
BCrypt::Password.new(bcrypt_password_hash)
|
||||
end
|
||||
|
||||
def bcrypt_cookie_password_hash
|
||||
bcrypt_password_hash.slice(20, 100)
|
||||
end
|
||||
|
||||
def password=(new_password)
|
||||
@password = new_password
|
||||
self.bcrypt_password_hash = User.bcrypt(new_password)
|
||||
@@ -205,15 +201,6 @@ class User < ApplicationRecord
|
||||
end
|
||||
end
|
||||
|
||||
def authenticate_cookie_hash(name, hash)
|
||||
user = find_by_name(name)
|
||||
if user && user.bcrypt_cookie_password_hash == hash
|
||||
user
|
||||
else
|
||||
nil
|
||||
end
|
||||
end
|
||||
|
||||
def bcrypt(pass)
|
||||
BCrypt::Password.create(sha1(pass))
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user