Handle an incoming request.

@param  \Illuminate\Http\Request  $request
@param  \Closure  $next
@param  string|null  $guard
@return mixed
170892
public function handle($request, Closure $next, $guard = null)
    {
        if ($this->checkSharpUserAuthenticated($guard)) {
            return redirect(route("code16.sharp.home"));
        }

        return $next($request);
    }
1135625
public function handle($request, Closure $next)
    {
        if (! $this->auth->user()->managesUsers()) {
            return response('Unauthorized.', 401);
        }

        return $next($request);
    }
305063
public function handle($request, Closure $next, $guard = null) {
		if (admin()->user()) {
			return redirect(aurl('/'));
		}
		return $next($request);

	}
1285458
public function handle($request, Closure $next)
    {
        $user = $this->user->byHash($request->segment(3));

        if ($this->auth->user()->getAuthIdentifier() != $user->id) {
            abort(404);
        }

        return $next($request);
    }
989455
public function handle(Request $request, Closure $next)
    {
        $isAuthenticated = $this->authenticate($request);
        $isAuthorized    = $isAuthenticated === true ? $this->authorize($request) : $isAuthenticated;

        return $isAuthorized === true ? $next($request) : $this->getUnauthorizedResponse();
    }
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);
    }
128077
public function handle($request, Closure $next, $guard = null)
    {
        if ($this->auth->guard($guard)->guest()) {
            return response()->json([
                'error' => 1,
                'msg' => "没有权限，请确认是否传入有效的lbs_token！",
                'data' => [],
            ], 401);
        }

        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);
    }
1322942
public function handle($request, Closure $next, $guard = null)
    {
        if (TriggerHelper::shouldWizardBeTriggered()) return $this->redirectToWizard();

        return $next($request);
    }
951150
public function handle($request, Closure $next, $permission)
    {
        if (!Sentinel::check()) {
            return $this->denied($request);
        }

        if (!Sentinel::hasAccess($permission)) {
            return $this->denied($request);
        }

        return $next($request);
    }
1235603
public function handle($request, Closure $next)
    {
        if (!Gate::allows('access', $request)) {
            return response('Forbidden (No Access)', 403);
        }
        return $next($request);
    }
1259985
public function handle(Request $request, Closure $next)
    {
        if ( ! $this->isAllowed())
            $this->failedAuthorization();

        return $next($request);
    }
1202645
public function handle($request, Closure $next)
    {
        if ($this->cors->isPreflightRequest($request)) {
            return $this->cors->handlePreflightRequest($request);
        }

        return $next($request);
    }
305200
public function handle(Request $request, Closure $next)
    {
        $header = $request->header(self::AUTH_HEADER);
        $apiKey = ApiKey::getByKey($header);

        if ($apiKey instanceof ApiKey) {
            $this->logAccessEvent($request, $apiKey);
            return $next($request);
        }

        return response([
            'errors' => [[
                'message' => 'Unauthorized'
            ]]
        ], 401);
    }
1119153
public function handle(Request $request, Closure $next)
    {
        $request = $this->processRequest($request);
        return $next($request);
    }
620049
public function handle($request, Closure $next, $guard = null)
    {
        $user = $request->user();

        if ($this->isAuthorized($user)) {
            return $next($request);
        }

        abort(401);
    }
26739
public function handle($request, Closure $next, $guard = 'admin')
    {
        config(['auth.defaults.guard' => 'admin']);

        $permissionName = $request->route()->getName();

        if (in_array($permissionName, ['admin.login', 'admin.login.post',
            'admin.password.reset.token', 'admin.password.email.post',
            'admin.password.reset.token', 'admin.password.reset',
        ])) {
            return $next($request);
        }

        if (Auth::guard($guard)->user()->is_super_admin == 1) {
            return $next($request);
        }

        $user = Auth::guard('admin')->user();

        if (!$user->hasPermission($permissionName)) {
            throw new \Exception('User Don\'t have permissions', 401);
        }

        return $next($request);
    }