use ‚required|string‘ to validate usernames
This commit is contained in:
parent
0b2c5279a8
commit
4fc832838b
1 changed files with 2 additions and 2 deletions
|
@ -87,11 +87,11 @@ class LoginController extends Controller
|
|||
*/
|
||||
public function login(Request $request)
|
||||
{
|
||||
// Check wether login is an email address or a username
|
||||
// Check wether the user identifier is an email address or a username
|
||||
$isEmail = str_contains($request->input('user'), '@');
|
||||
|
||||
$this->validate($request, [
|
||||
'user' => $isEmail ? 'required|email' : 'required',
|
||||
'user' => $isEmail ? 'required|email' : 'required|string',
|
||||
'password' => 'required',
|
||||
]);
|
||||
|
||||
|
|
Loading…
Reference in a new issue