1
0
mirror of https://github.com/iv-org/invidious.git synced 2025-03-14 09:56:41 -04:00

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

@ -123,7 +123,7 @@ module Invidious::Routes::Account
return error_template(400, ex) return error_template(400, ex)
end 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? if new_username.nil?
return error_template(401, "username_required_field") return error_template(401, "username_required_field")
end end