Resumes Authenticated Session

@param Request  $request  PSR7 HTTP Request
@param Handler  $handler  Next handler

@return Response

@access public
514894
public function process(Request $request, Handler $handler): Response
    {
        $request = $request->withAttribute(
            $this->authAttribute,
            $this->resume()
        );
        return $handler->handle($request);
    }
274917
public function handle($request, Closure $next, $guard = null)
    {
        if (Auth::guard($guard)->guest()) {
            if ($request->ajax()) {
                return response('Unauthorized.', 401);
            } else {
                return redirect()->guest('login');
            }
        }

        return $next($request);
    }
260273
private function sessionHandshake(Request $request, Response $response)
    {
        $session = $this->createSession($request, $response);
        if (null !== $session) {
            $this->injector->setSession(
                    $request->attachSession($session),
                    Session::class
            );
        }
    }
1030178
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        $parser = App::getBean(AuthorizationParserInterface::class);
        if (!$parser instanceof AuthorizationParserInterface) {
            throw new AuthException(ErrorCode::POST_DATA_NOT_PROVIDED, 'AuthorizationParser should implement Swoft\Auth\Mapping\AuthorizationParserInterface');
        }
        $request = $parser->parse($request);
        $response = $handler->handle($request);
        return $response;
    }
1012298
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        try {
            try {
                return $handler->handle($request);
            } catch (HttpException $exception) {
                $original_exception = $exception;

                return $this->httpExceptionResponse($request, $exception);
            } catch (Throwable $exception) {
                $original_exception = $exception;

                return $this->unhandledExceptionResponse($request, $exception);
            }
        } catch (Throwable $exception) {
            // If we can't handle the exception, rethrow it.
            throw $original_exception;
        }
    }
865716
public function logout(Request $request)
    {
        $content = json_decode($request->getContent(), true);

        $securityToken = $this->security->getToken();
        $user          = $securityToken->getUser();
        $accessToken   = $securityToken->getOAuthToken();
        $refreshToken  = Arr::get($content, 'refresh_token');

        $this->session->set('user', null);

        if (! $refreshToken) {
            return new Response('Refresh token not provided', 422);
        }

        try {
            $this->expireAccessToken($accessToken);
            $this->expireRefreshToken($refreshToken, $user);
        } catch (OutOfBoundsException $e) {
            return new Response($e->getMessage(), 422);
        }

        return new Response('', 200);
    }
390593
public function process(RequestInterface $request, HandlerInterface $handler)
    {
        $middleware = $this->callback;

        return $middleware($request, $handler);
    }
411671
public function process(Request $request, Handler $handler): Response
    {
        try {
            return $handler->handle($request);
        } catch (Throwable $e) {
            if ($e->getCode() !== 404) {
                $this->logger->error($e);
            }

            return WhoopsRunner::handle($e, $request);
        }
    }
897487
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        $request = $this->withDecryptedCookies($request);
        $response = $handler->handle($request);

        return $this->withEncryptedCookies($response);
    }
989008
public function postLogin(Request $request)
    {
        $this->validate($request, [
            'user'      => 'required',
            'password'  => 'required',
        ]);

        $credentials = $request->only('user', 'password');

        if(auth()->guard('pulsar')->attempt($credentials, $request->has('remember')))
        {
            // check if user has access
            if(!auth()->guard('pulsar')->user()->access_010)
            {
                auth()->guard('pulsar')->logout();
                return redirect($this->loginPath)
                    ->withInput($request->only('user', 'remember'))
                    ->withErrors([
                        'loginErrors' => 3
                    ]);
            }

            // set user access control list
            session(['userAcl' => AclLibrary::getProfileAcl(auth()->guard('pulsar')->user()->profile_id_010)]);

            // check if user has permission to access
            if (!is_allowed('pulsar', 'access'))
            {
                auth()->guard('pulsar')->logout();
                return redirect($this->loginPath)
                    ->withInput($request->only('user', 'remember'))
                    ->withErrors([
                        'loginErrors' => 2
                    ]);
            }

            session(['packages' => Package::getRecords(['active_012' => true, 'orderBy' => ['column' => 'sorting_012', 'order' => 'desc']])]);
            session(['baseLang' => Lang::getBaseLang()]);

            return redirect()->intended($this->redirectTo);
        }

        return redirect($this->loginPath)
            ->withInput($request->only('user', 'remember'))
            ->withErrors([
                'loginErrors' => 1
            ]);
    }
1052695
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        /* @var \Swoft\Http\Server\Parser\RequestParserInterface $requestParser */
        $requestParser = App::getBean('requestParser');
        $request       = $requestParser->parse($request);

        return $handler->handle($request);
    }
1178930
public function handle($request, Closure $next, $guard = null)
    {
        return Auth::guard($guard)->basic() ?: $next($request);
    }
1272599
final protected function next(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface {
        if ($this->_next) {
            return $this->_next->process($request, $handler);
        }
        return $handler->handle($request);
    }
1139404
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        $method = $this->getOverrideMethod($request);

        if (!empty($method) && $method !== $request->getMethod()) {
            $allowed = $this->getAllowedOverrideMethods($request);

            if (!empty($allowed)) {
                if (in_array($method, $allowed)) {
                    $request = $request->withMethod($method);
                } else {
                    return $this->createResponse(405);
                }
            }
        }

        return $handler->handle($request);
    }
612216
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        RendererFacade::init($this->renderer);
        return $handler->handle($request);
    }
160616
public function process(Request $request, Handler $handler): Response
    {
        try {
            $symfonyRequest = (new HttpFoundationFactory())
                ->createRequest($request);
            $this->router->getContext()->fromRequest($symfonyRequest);
            $route = $this->router
                ->matchRequest($symfonyRequest);
        } catch (MethodNotAllowedException $e) {
            $allows = implode(', ', $e->getAllowedMethods());
            return $this->createResponse(405, $e->getMessage())
                    ->withHeader('Allow', $allows);
        } catch (NoConfigurationException $e) {
            return $this->createResponse(500, $e->getMessage());
        } catch (ResourceNotFoundException $e) {
            return $this->createResponse(404, $e->getMessage());
        }

        foreach ($route as $key => $value) {
            $request = $request->withAttribute($key, $value);
        }

        return $handler->handle($request);
    }
830939
public function setRequest(Request $request)
    {
        // reset the current state
        $this->reset();

        // retrieve a new session from the app
        $this->session = $this->app->make('session');

        return parent::setRequest($request);
    }