mirror of
https://github.com/iv-org/invidious.git
synced 2025-08-28 15:38:30 +00:00
Update authentication.cr
This commit is contained in:
parent
5d22ca51c9
commit
5cbdffd4cd
@ -92,7 +92,7 @@ module Invidious::Routes::API::V1::Authentication
|
|||||||
if !CONFIG.login_enabled
|
if !CONFIG.login_enabled
|
||||||
return error_json(400, "Login has been disabled by administrator")
|
return error_json(400, "Login has been disabled by administrator")
|
||||||
else
|
else
|
||||||
creds = Invidious::Routes::API::V1::Authentication::Login.from_json(env.request.body || "{}")
|
creds = CredentialsLogin.from_json(env.request.body || "{}")
|
||||||
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
|
||||||
@ -149,7 +149,7 @@ struct Credentials
|
|||||||
property password : String
|
property password : String
|
||||||
end
|
end
|
||||||
|
|
||||||
struct Login
|
struct CredentialsLogin
|
||||||
include JSON::Serializable
|
include JSON::Serializable
|
||||||
include YAML::Serializable
|
include YAML::Serializable
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user