From 0c83eb2c39161bfcf2152a4a1cf616b31fb16b95 Mon Sep 17 00:00:00 2001 From: Fijxu Date: Sat, 8 Mar 2025 02:32:39 -0300 Subject: [PATCH] fix: downcase username and limit username lenght (from routes/login.cr) Users that changed their username to something like `User`, were unable to login because the username is downcased on routes/login.cr --- src/invidious/routes/account.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/invidious/routes/account.cr b/src/invidious/routes/account.cr index b68aefd1..4eff5e1d 100644 --- a/src/invidious/routes/account.cr +++ b/src/invidious/routes/account.cr @@ -123,7 +123,7 @@ module Invidious::Routes::Account return error_template(400, ex) end - new_username = env.params.body["new_username"]? + new_username = env.params.body["new_username"]?.try &.downcase.byte_slice(0, 254) if new_username.nil? return error_template(401, "username_required_field") end