mirror of
https://github.com/iv-org/invidious.git
synced 2025-06-07 06:22:52 -04:00
Update authentication.cr
This commit is contained in:
parent
f6a8c60e6e
commit
1516f53932
1 changed files with 1 additions and 1 deletions
|
@ -9,7 +9,7 @@ module Invidious::Routes::API::V1::Authentication
|
||||||
user = Invidious::Database::Users.select(email: creds.username)
|
user = Invidious::Database::Users.select(email: creds.username)
|
||||||
old_sid = creds.token
|
old_sid = creds.token
|
||||||
if user
|
if user
|
||||||
if Crypto::Bcrypt::Password.new(creds.password).verify(password.byte_slice(0, 55))
|
if Crypto::Bcrypt::Password.new(creds.password).verify(creds.password.byte_slice(0, 55))
|
||||||
sid = Base64.urlsafe_encode(Random::Secure.random_bytes(32))
|
sid = Base64.urlsafe_encode(Random::Secure.random_bytes(32))
|
||||||
Invidious::Database::SessionIDs.insert(sid, email)
|
Invidious::Database::SessionIDs.insert(sid, email)
|
||||||
if old_sid != ""
|
if old_sid != ""
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue