- if (!$user->exists && $user->email === null && !$request->filled('email')) {
- $request->flash();
- session()->flash('request-email', true);
- return redirect('/login');
+ /**
+ * Send the response after the user was authenticated.
+ * @return RedirectResponse
+ */
+ protected function sendLoginResponse(Request $request)
+ {
+ $request->session()->regenerate();
+ $this->clearLoginAttempts($request);
+
+ return redirect()->intended('/');
+ }
+
+ /**
+ * Attempt to log the user into the application.
+ */
+ protected function attemptLogin(Request $request): bool
+ {
+ return $this->loginService->attempt(
+ $this->credentials($request),
+ auth()->getDefaultDriver(),
+ $request->filled('remember')
+ );
+ }
+
+
+ /**
+ * Validate the user login request.
+ * @throws ValidationException
+ */
+ protected function validateLogin(Request $request): void
+ {
+ $rules = ['password' => ['required', 'string']];
+ $authMethod = config('auth.method');
+
+ if ($authMethod === 'standard') {
+ $rules['email'] = ['required', 'email'];