Skip to content

Commit

Permalink
修复错误
Browse files Browse the repository at this point in the history
  • Loading branch information
sonhineboy committed May 23, 2020
1 parent bf5bcab commit de1e218
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/Http/Controllers/AuthController.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,16 @@ public function postLogin(Request $request)
$credentials = $request->only([$this->username(), 'password']);
$remember = (bool) $request->input('remember', false);

/** @var \Illuminate\Validation\Validator $validator */
$validator = Validator::make(array_merge($credentials,[$this->getcaptchaName()=>$request->post($this->getcaptchaName())]), [
$this->username() => 'required',
'password' => 'required',
$this->getcaptchaName() => 'required|kcaptcha'
]);

if ($validator->fails()) {
return $this->validationErrorsResponse($validator);
}
// If the class is using the ThrottlesLogins trait, we can automatically throttle
// the login attempts for this application. We'll key this by the username and
// the IP address of the client making these requests into this application.
Expand All @@ -73,16 +83,6 @@ public function postLogin(Request $request)

if ($this->guard()->attempt($credentials, $remember)) {

/** @var \Illuminate\Validation\Validator $validator */
$validator = Validator::make(array_merge($credentials,[$this->getcaptchaName()=>$request->post($this->getcaptchaName())]), [
$this->username() => 'required',
'password' => 'required',
$this->getcaptchaName() => 'required|kcaptcha'
]);

if ($validator->fails()) {
return $this->validationErrorsResponse($validator);
}


return $this->sendLoginResponse($request);
Expand Down

0 comments on commit de1e218

Please sign in to comment.