@@ -162,7 +162,9 @@ discard block |
||
162 | 162 | $payload['iat'] = $this->get_param_iat(); |
163 | 163 | $ar['token'] = $this->token_encode($payload); |
164 | 164 | |
165 | - if (isset($ar['data'])) unset($ar['data']); |
|
165 | + if (isset($ar['data'])) { |
|
166 | + unset($ar['data']); |
|
167 | + } |
|
166 | 168 | } |
167 | 169 | $json = json_encode($ar, JSON_UNESCAPED_SLASHES); |
168 | 170 | |
@@ -216,8 +218,7 @@ discard block |
||
216 | 218 | try |
217 | 219 | { |
218 | 220 | $token = JWT::encode($payload, $this->own_private_key(), 'RS512'); |
219 | - } |
|
220 | - catch (\Exception $e) |
|
221 | + } catch (\Exception $e) |
|
221 | 222 | { |
222 | 223 | Log::instance()->error($e->getMessage().PHP_EOL.$e->getTraceAsString()); |
223 | 224 | throw new Exception\JSON('unable to create JWT token', $e); |
@@ -247,8 +248,7 @@ discard block |
||
247 | 248 | $body = $httpresponse->getBody()->getContents(); |
248 | 249 | Log::instance()->debug('got response:'.PHP_EOL.$body); |
249 | 250 | $response = new $this->response_class($body, $this->jwt); |
250 | - } |
|
251 | - catch (\GuzzleHttp\Exception\TransferException $e) |
|
251 | + } catch (\GuzzleHttp\Exception\TransferException $e) |
|
252 | 252 | { |
253 | 253 | Log::instance()->debug('request:'.PHP_EOL.\GuzzleHttp\Psr7\str($e->getRequest())); |
254 | 254 | if ($e->hasResponse()) { |
@@ -139,8 +139,7 @@ |
||
139 | 139 | try |
140 | 140 | { |
141 | 141 | $decoded = (array) JWT::decode($token, $this->uapay_public_key(), array('RS512')); |
142 | - } |
|
143 | - catch (\Exception $e) |
|
142 | + } catch (\Exception $e) |
|
144 | 143 | { |
145 | 144 | Log::instance()->error($e->getMessage().PHP_EOL.$e->getTraceAsString()); |
146 | 145 | throw new Exception\JSON('unable to decode JWT token', $e); |