Update authentication.cr

This commit is contained in:
Ryan G 2023-06-12 19:27:03 -07:00
parent 63c31a9217
commit 60ef753fd1

View File

@ -20,15 +20,9 @@ module Invidious::Routes::API::V1::Authentication
if creds if creds
# user is registering # user is registering
username = creds.username username = creds.username
username ||= ""
password = creds.password password = creds.password
password ||= ""
if username.nil? || username.empty?
return error_json(401, "User ID is a required field")
end
if password.nil? || password.empty?
return error_json(401, "Password is a required field")
end
if username.empty? if username.empty?
return error_json(401, "Username cannot be empty") return error_json(401, "Username cannot be empty")