mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-08-07 23:03:00 +03:00
Users: Changed name validation to min:1 instead of 2
Would cause scenarios where users could be created with 1 char, but then fail to update due to validation differences. Added test to cover. For #5263
This commit is contained in:
@@ -37,7 +37,7 @@ class UserApiController extends ApiController
|
||||
{
|
||||
return [
|
||||
'create' => [
|
||||
'name' => ['required', 'string', 'min:2', 'max:100'],
|
||||
'name' => ['required', 'string', 'min:1', 'max:100'],
|
||||
'email' => [
|
||||
'required', 'string', 'email', 'min:2', new Unique('users', 'email'),
|
||||
],
|
||||
@@ -49,7 +49,7 @@ class UserApiController extends ApiController
|
||||
'send_invite' => ['boolean'],
|
||||
],
|
||||
'update' => [
|
||||
'name' => ['string', 'min:2', 'max:100'],
|
||||
'name' => ['string', 'min:1', 'max:100'],
|
||||
'email' => [
|
||||
'string',
|
||||
'email',
|
||||
|
Reference in New Issue
Block a user