Validate that username/password is not empty
This commit is contained in:
parent
07f0960c8c
commit
a17262e81e
@ -96,12 +96,12 @@ class UserController extends Controller
|
||||
|
||||
$newUser = new User();
|
||||
|
||||
if (!isset($projectData['username'])) {
|
||||
if (!isset($projectData['username']) || empty($projectData['username'])) {
|
||||
return new ErrorResponse(0, "You must provide a username");
|
||||
}
|
||||
$newUser->setUsername($projectData['username']);
|
||||
|
||||
if (!isset($projectData['password'])) {
|
||||
if (!isset($projectData['password']) || empty($projectData['password'])) {
|
||||
return new ErrorResponse(1, "You must provide a password");
|
||||
}
|
||||
$newUser->setPassword($passwordEncoder->encodePassword(
|
||||
|
Loading…
Reference in New Issue
Block a user