boot($request); if ($authenticator->isAuthenticated() || ! $request->user()->two_factor_enabled) { return $next($request); } if (! Str::endsWith($request->url(), '/login/2fa')) { $request->session()->put([ 'intended_path' => $request->fullUrl(), ]); } return $authenticator->makeRequestOneTimePasswordResponse(); } }