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:
evazion
2020-03-25 03:01:43 -05:00
parent 4b1114b4a4
commit 9e455695a1
6 changed files with 1 additions and 62 deletions

View File

@@ -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