mirror of
https://github.com/iv-org/invidious.git
synced 2025-04-06 21:13:45 -04:00
Update src/invidious/routes/account.cr
Co-authored-by: syeopite <70992037+syeopite@users.noreply.github.com>
This commit is contained in:
parent
deb342b3e6
commit
31b48ec512
@ -124,14 +124,10 @@ module Invidious::Routes::Account
|
||||
end
|
||||
|
||||
new_username = env.params.body["new_username"]?.try &.downcase.byte_slice(0, 254)
|
||||
if new_username.nil?
|
||||
if new_username.nil? || new_username.empty?
|
||||
return error_template(401, "accounts_username_required_field")
|
||||
end
|
||||
|
||||
if new_username.empty?
|
||||
return error_template(401, "accounts_username_empty")
|
||||
end
|
||||
|
||||
if new_username == user.email
|
||||
return error_template(401, "accounts_username_is_the_same")
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user