-
How I can create the params ClaimsFormatter and Encoder to pass them to Builder constructor?? Error: "Too few arguments to function Lcobucci\JWT\Token\Builder::__construct(), 0 passed in C:\xampp\htdocs\symfony\proyectoBassClefSymfony\src\Controller\ChatController.php on line 27 and exactly 2 expected" Code: public function chat()
{
$key = InMemory::plainText('koshensx');
$username = $this->getUser()->getUsername();
$token = (new Builder())
->withClaim('mercure', ['subscribe' => [sprintf("/%s", $username)]])
->getToken(
new Sha256(),
new Key($key)
)
; |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
By default, the The Lines 104 to 107 in 207955d Lines 47 to 49 in 207955d |
Beta Was this translation helpful? Give feedback.
By default, the
Builder
is something you can get from aLcobucci\JWT\Configuration
instance, as explained in https://github.com/lcobucci/jwt/blob/207955dfbce28b4fbdc12367fbccf9546c66eb2d/docs/issuing-tokens.mdThe
Configuration#builder()
uses a closure internally to give you a cleanBuilder
each time:jwt/src/Configuration.php
Lines 104 to 107 in 207955d
jwt/src/Configuration.php
Lines 47 to 49 in 207955d