Update authentication.cr

This commit is contained in:
Ryan G 2023-06-11 20:08:33 -07:00
parent 1516f53932
commit 3df349b433

View File

@ -11,7 +11,7 @@ module Invidious::Routes::API::V1::Authentication
if user
if Crypto::Bcrypt::Password.new(creds.password).verify(creds.password.byte_slice(0, 55))
sid = Base64.urlsafe_encode(Random::Secure.random_bytes(32))
Invidious::Database::SessionIDs.insert(sid, email)
Invidious::Database::SessionIDs.insert(sid, creds.username)
if old_sid != ""
Invidious::Database::SessionIDs.delete(old_sid)
end