+ return view('auth.login', [
+ 'socialDrivers' => $socialDrivers,
+ 'authMethod' => $authMethod,
+ ]);
+ }
+
+ /**
+ * Handle a login request to the application.
+ *
+ * @param \Illuminate\Http\Request $request
+ *
+ * @throws \Illuminate\Validation\ValidationException
+ *
+ * @return \Illuminate\Http\RedirectResponse|\Illuminate\Http\Response|\Illuminate\Http\JsonResponse
+ */
+ public function login(Request $request)
+ {
+ $this->validateLogin($request);
+ $username = $request->get($this->username());
+
+ // 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.
+ if (method_exists($this, 'hasTooManyLoginAttempts') &&
+ $this->hasTooManyLoginAttempts($request)) {
+ $this->fireLockoutEvent($request);
+
+ Activity::logFailedLogin($username);
+
+ return $this->sendLockoutResponse($request);