@@ -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); |
@@ -204,8 +205,7 @@ discard block |
||
204 | 205 | $body = $httpresponse->getBody()->getContents(); |
205 | 206 | Log::instance()->debug('got response:'.PHP_EOL.$body); |
206 | 207 | return new $this->response_class($body, $this->jwt); |
207 | - } |
|
208 | - catch (\GuzzleHttp\Exception\RequestException $e) |
|
208 | + } catch (\GuzzleHttp\Exception\RequestException $e) |
|
209 | 209 | { |
210 | 210 | $this->handle_request_exception($e); |
211 | 211 | } |