Handle an incoming request.

@param  \Illuminate\Http\Request $request
@param  \Closure                 $next
@param  string|null              $guard

@return mixed
336461
public function handle($request, Closure $next, $guard = null)
    {
        // Send a forbidden status if wizard should not be triggered
        if (TriggerHelper::hasWizardCompleted()) return $this->forbiddenResponse();

        // Get the current step from the route slug
        $currentStepSlug = $request->route()->getParameter('slug', '');
        \SetupWizard::initialize($currentStepSlug);

        // Share common data with our views
        view()->share('currentStep', \SetupWizard::currentStep());
        view()->share('allSteps', \SetupWizard::steps());

        // Proceed as usual
        return $next($request);
    }
1164382
public function handle($request, Closure $next)
    {
        if (! AuthRagnarok::check()) {
            if ($request->ajax()) {
                return response('Unauthorized.', 401);
            } else {
                return redirect()->guest('/auth/login');
            }
        }

        return $next($request);
    }
462069
public function handle($request, Closure $next)
    {
        $token = $this->getTokenFromRequest($request);
        $this->jwt->setToken($token)->validateOrFail();

        return $next($request);
    }
252307
public function handle( $request, Closure $next, $guard = null )
	{
		if ( Acct::check() )
			return Redirect::to( '/' );

		return $next( $request );
	}
620365
public function handle($request, Closure $next, ...$guards)
    {
        config()->set('auth.defaults.guard', 'soda');

        try {
            $this->authenticate(['soda']);

            if (env('APP_ENV') == 'production' && $request->route()->getName() !== 'soda.reset-weak-password') {
                foreach ($this->unsafePasswords as $unsafePassword) {
                    if ($this->hasher->check($unsafePassword, $request->user()->getAuthPassword())) {
                        return Soda::resetPassword();
                    }
                }
            }
        } catch (AuthenticationException $e) {
            return $this->unauthenticated($request, $e);
        }

        return $next($request);
    }
805307
public function handle($request, Closure $next)
    {
        if( auth()->check() ) {
            $user = auth()->user();
            $user->updateLastActivity();
        }

        return $next($request);
    }
285554
public function handle($request, Closure $next)
    {
        $route = $this->router->getCurrentRoute();

        if (! $this->auth->check(false)) {
            $this->auth->authenticate($route->getAuthenticationProviders());
        }

        return $next($request);
    }
1257827
public function handle(Request $request, Closure $next)
    {
        if ($this->auth->guest()) {
            if ($request->ajax()) {
                return response('Unauthorized.', 401);
            }

            return redirect()->guest(\Flare::adminUrl('login'));
        }

        return $next($request);
    }
229938
public function handle($request, Closure $next, $guard = null)
    {
        if (Auth::guard($guard)->check()) {
            $user = Auth::guard($guard)->user();
            $site = $user->site ?: site();
            $root = $site->getRootUrl();
            $userSlug = getSlug('userhome');

            $url = $root.'/'.$userSlug;
            return redirect()->away($url);
        }

        return $next($request);
    }
170892
public function handle($request, Closure $next, $guard = null)
    {
        if ($this->checkSharpUserAuthenticated($guard)) {
            return redirect(route("code16.sharp.home"));
        }

        return $next($request);
    }
807593
public function handle($request, Closure $next, $guard = null)
    {
        $this->guard = $guard;

        $response = $next($request);

        if ($this->shouldReceiveFreshToken($request, $response)) {
            $response->withCookie($this->cookieFactory->make(
                $request->user($this->guard)->getKey(), $request->session()->token()
            ));
        }

        return $response;
    }
185657
public function handle($request, Closure $next, $guard = null)
    {
        try {
            $authinfo = \Besofty\Web\Attendance\Model\User::details(\Session::get('authinfo'));
            $roleID = \Besofty\Web\Attendance\Model\UsersRole::getRoleID($authinfo['id']);
            $userRole = \Besofty\Web\Attendance\Model\Role::getName($roleID['role_id']);
            $isAdmin = Role::isAdmin($userRole['slug']);

            if ($isAdmin['slug'] != 'super-administrator' && $isAdmin['slug'] != 'administrator' ) {
                return redirect('/logout');
            }
            return $next($request);
        } catch (\Exception $exception) {
            throw $exception;
        }
    }
1355865
public function handle($request, Closure $next)
    {
        $as = $request->input('_as');

        if ($this->authorize() && ! is_null($as)) {
            $this->auth->loginUsingId($as);

            return $this->response->redirectTo($request->url());
        }

        return $next($request);
    }
722332
public function handle($request, Closure $next)
    {
        $redirectTo = admin_base_path(config('admin.auth.redirect_to', 'auth/login'));

        if (Auth::guard('admin')->guest() && !$this->shouldPassThrough($request)) {
            return redirect()->guest($redirectTo);
        }

        return $next($request);
    }
1002403
public function handle($request, Closure $next, $role)
    {
        $this->authorize($role);

        return $next($request);
    }
613033
public function handle($request, Closure $next)
    {
        try {
            if ($user = $this->auth->authenticate()) {
                $request->setUserResolver(function () use ($user) {
                    return $user;
                });
            }
        } catch (AuthenticationException $e) {
            // do nothing
        }

        return $next($request);
    }
1054986
public function handle($request, Closure $next)
    {
        $this->credentials->getThrottleProvider()->enable();

        return $next($request);
    }