feat: Allow object as payload
Changed JWT::encode and JWT::jsonEncode so that they now accept an object as well as an array as their first argument.
As the result of JWT::decode is an object it only makes sense that the same object can be encoded again.
This also makes the use case of using JWT as a session manager more straight forward as you can just encode and decode the user object directly without array conversions.
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
View this failed invocation of the CLA check for more information.
For the most up to date status, view the checks section at the bottom of the pull request.
I have added a single test that just uses an object payload instead of array.
As long as we're sure it can encode that everything else works exactly the same as an array payload, so any further test seemed redundant.