mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-03-16.git
synced 2024-08-15 00:53:18 +00:00
Fix downcasting with usernames
This commit is contained in:
parent
2a6c81a89d
commit
7a8d5a391a
1 changed files with 2 additions and 2 deletions
|
@ -814,7 +814,7 @@ post "/login" do |env|
|
||||||
next templated "error"
|
next templated "error"
|
||||||
end
|
end
|
||||||
|
|
||||||
email = env.params.body["email"]?
|
email = env.params.body["email"]?.try &.downcase
|
||||||
password = env.params.body["password"]?
|
password = env.params.body["password"]?
|
||||||
|
|
||||||
account_type = env.params.query["type"]?
|
account_type = env.params.query["type"]?
|
||||||
|
@ -1024,7 +1024,7 @@ post "/login" do |env|
|
||||||
next templated "error"
|
next templated "error"
|
||||||
end
|
end
|
||||||
|
|
||||||
user = PG_DB.query_one?("SELECT * FROM users WHERE LOWER(email) = LOWER($1)", email, as: User)
|
user = PG_DB.query_one?("SELECT * FROM users WHERE email = $1", email, as: User)
|
||||||
|
|
||||||
if user
|
if user
|
||||||
if !user.password
|
if !user.password
|
||||||
|
|
Loading…
Reference in a new issue