@@ -140,7 +140,9 @@ discard block |
||
| 140 | 140 | $payload['iat'] = $this->get_param_iat(); |
| 141 | 141 | $ar['token'] = $this->token_encode($payload); |
| 142 | 142 | |
| 143 | - if (isset($ar['data'])) unset($ar['data']); |
|
| 143 | + if (isset($ar['data'])) { |
|
| 144 | + unset($ar['data']); |
|
| 145 | + } |
|
| 144 | 146 | } |
| 145 | 147 | $json = json_encode($ar, JSON_UNESCAPED_SLASHES); |
| 146 | 148 | |
@@ -174,8 +176,7 @@ discard block |
||
| 174 | 176 | try |
| 175 | 177 | { |
| 176 | 178 | $token = JWT::encode($payload, $this->own_private_key(), 'RS512'); |
| 177 | - } |
|
| 178 | - catch (\Exception $e) |
|
| 179 | + } catch (\Exception $e) |
|
| 179 | 180 | { |
| 180 | 181 | Log::instance()->error($e->getMessage().PHP_EOL.$e->getTraceAsString()); |
| 181 | 182 | throw new Exception\JSON('unable to create JWT token', $e); |
@@ -205,8 +206,7 @@ discard block |
||
| 205 | 206 | $body = $httpresponse->getBody()->getContents(); |
| 206 | 207 | Log::instance()->debug('got response:'.PHP_EOL.$body); |
| 207 | 208 | $response = new $this->response_class($body, $this->jwt); |
| 208 | - } |
|
| 209 | - catch (\GuzzleHttp\Exception\RequestException $e) |
|
| 209 | + } catch (\GuzzleHttp\Exception\RequestException $e) |
|
| 210 | 210 | { |
| 211 | 211 | Log::instance()->debug('request:'.PHP_EOL.\GuzzleHttp\Psr7\str($e->getRequest())); |
| 212 | 212 | if ($e->hasResponse()) { |