GenTux\Jwt\JwtPayloadInterface::getPayload PHP Method

getPayload() public method

Get the payload for JWT token
public getPayload ( ) : array
return array
    public function getPayload();

Usage Example

Esempio n. 1
0
 public function it_creates_new_tokens_from_a_jwt_payload_interface_object(JwtPayloadInterface $payload, JwtDriverInterface $jwt)
 {
     $jwt->createToken(['foo' => 'bar'], 'secret_123', 'HS256')->willReturn('newtoken_123');
     $payload->getPayload()->willReturn(['foo' => 'bar']);
     $result = $this->createToken($payload)->shouldHaveType(JwtToken::class);
     if ($result->token() !== 'newtoken_123') {
         throw new \Exception('New token was not set correctly.');
     }
 }
JwtPayloadInterface