confirmationService = $confirmationService; } /** * Handle an incoming request. * * @param \Illuminate\Http\Request $request * @param \Closure $next * @return mixed */ public function handle($request, Closure $next) { /** @var User $user */ $user = auth()->user(); if (auth()->check() && !$user->email_confirmed && $this->confirmationService->confirmationRequired()) { auth()->logout(); return redirect()->to('/'); } return $next($request); } }