コード例 #1
0
 /**
  * @param JwtContext $context
  */
 public function handleContext(JwtContext $context)
 {
     if ($context->getResponseJwt()) {
         $keys = $context->optionGet(ContextOptions::KEYS);
         if ($this->logger) {
             $this->logger->debug('EncoderHandler.keys', array('keys' => $keys));
         }
         if (is_array($keys)) {
             $token = $this->encoder->encode($context->getResponseJwt(), array_shift($keys));
             if ($this->logger) {
                 $this->logger->debug('EncoderHandler.token', array('token' => $token));
             }
             $context->setResponseToken($token);
         }
     } else {
         if ($this->logger) {
             $this->logger->debug('EncoderHandler.noResponseJwt');
         }
     }
 }