getDto(); $result = $this->authService->authorization($authorization); if ($result->isError()) { if ($result->getCode() === Response::HTTP_UNAUTHORIZED) { Log::warning('Unauthorized ' . $authorization->getEmail() . ' [' . $request->getClientIp() . ']'); } return redirect()->route('login')->withInput()->withErrors($result->getMessage()); } $request->session()->regenerate(); Log::notice('Logged in ' . $authorization->getEmail() . ' [' . $request->getClientIp() . ']'); return redirect()->route('home'); } public function logout(Request $request): RedirectResponse { Auth::logout(); $request->session()->invalidate(); $request->session()->regenerateToken(); return redirect(route('login')); } }