summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOmar Roth <omarroth@hotmail.com>2019-04-18 19:17:50 -0500
committerOmar Roth <omarroth@hotmail.com>2019-04-18 19:17:58 -0500
commit7a8d5a391a29c3f4c6e326a667f80c2f4ff965bc (patch)
treeefed874a8a7442ce06eac3106e5328acd0d99644 /src
parent2a6c81a89dd64c00dff0b37af1c6637771aad27e (diff)
downloadinvidious-7a8d5a391a29c3f4c6e326a667f80c2f4ff965bc.tar.gz
invidious-7a8d5a391a29c3f4c6e326a667f80c2f4ff965bc.tar.bz2
invidious-7a8d5a391a29c3f4c6e326a667f80c2f4ff965bc.zip
Fix downcasting with usernames
Diffstat (limited to 'src')
-rw-r--r--src/invidious.cr4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/invidious.cr b/src/invidious.cr
index 33f35afa..4e48fab0 100644
--- a/src/invidious.cr
+++ b/src/invidious.cr
@@ -814,7 +814,7 @@ post "/login" do |env|
next templated "error"
end
- email = env.params.body["email"]?
+ email = env.params.body["email"]?.try &.downcase
password = env.params.body["password"]?
account_type = env.params.query["type"]?
@@ -1024,7 +1024,7 @@ post "/login" do |env|
next templated "error"
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.password