I just found a bug in registerUser function in user.controller.js
Description:-
The below if condition in registerUser function in user.controller.js is just checking for empty string.
It throws error only if fullName, email, username and password are empty.
However if any field is missing or not sent by the client then it does not handle that.
For example, if username is not supplied by the client then it will not throw any error.
if (
[fullName, email, username, password].some((field) => field?.trim() === "")
) {
throw new ApiError(400, "All fields are required")
}
I just found a bug in registerUser function in user.controller.js
Description:- The below if condition in registerUser function in user.controller.js is just checking for empty string. It throws error only if fullName, email, username and password are empty. However if any field is missing or not sent by the client then it does not handle that. For example, if username is not supplied by the client then it will not throw any error.
Correction: