Closed
Description
Hi,
There's a backwards compatibility break in the 6.1.0 release.
If you add an empty array as payload the error "Payload must be a JSON object" pops up if you decode the JWT.
How to reproduce
use Firebase\JWT\JWT;
use Firebase\JWT\Key;
$key = 'yma6Hq4XQegCVND8ef23OYgxSrC3IKqk';
$payload = [];
$jwt = JWT::encode($payload, $key, 'HS256');
$decoded = JWT::decode($jwt, new Key($key, 'HS256'));
Current (version 6.1.0) behaviour
An error pops up in JWT.php line 115 with the message "Payload must be a JSON object"
Expected (version 6.0.0) behaviour
No error occur when decoding JWT.
Variable $decoded is an empty array
Please take a look at this.
Kind regards
Metadata
Metadata
Assignees
Labels
No labels