コード例 #1
0
 function __invoke(ServerRequestInterface $request, ResponseInterface $response, callable $next)
 {
     $this->redirection->setRequest($request);
     switch ($request->getMethod()) {
         case 'GET':
             if (!$this->session->loggedIn()) {
                 return $this->redirection->guest($this->settings->getLoginUrl());
             }
             break;
     }
     return $next();
 }