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
This commit is contained in:
Fijxu 2025-03-08 02:32:39 -03:00
parent eff1a101c7
commit 0c83eb2c39
No known key found for this signature in database
GPG Key ID: 32C1DDF333EDA6A4

View File

@ -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