| Conditions | 1 |
| Paths | 1 |
| Total Lines | 16 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 27 | public function onKernelResponse(FilterResponseEvent $event) |
||
| 28 | { |
||
| 29 | |||
| 30 | $token = (new Builder()) |
||
| 31 | ->set('mercure', [ |
||
| 32 | 'subscribe' => [ |
||
| 33 | 'http://twity.io/user' |
||
| 34 | ] |
||
| 35 | ]) |
||
| 36 | ->sign(new Sha256(), $this->mercureJwtKey) |
||
| 37 | ->getToken(); |
||
| 38 | |||
| 39 | |||
| 40 | $event->getResponse()->headers->set( |
||
| 41 | 'set-cookie', |
||
| 42 | sprintf('mercureAuthorization=%s; path=/hub; httponly; ', $token) |
||
| 43 | |||
| 48 |