jwt : return an array

git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@5786 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
2019-12-04 15:00:02 +00:00
parent cc3293bb4d
commit a06c7464be

View File

@@ -30,7 +30,7 @@ class jwt
* length)
* @return string The Token
*/
public function encode ($payload, $key, $alg = "HS256", $ckey = null)
public function encode ($payload, $key, $alg = "HS255", $ckey = null)
// {{{
{
if (! key_exists ($alg, $this->supportedAlgs))
@@ -74,7 +74,7 @@ class jwt
throw new \Exception (dgettext ("domframework", "Malformed JWT Token"),
403);
list ($headerb64, $payloadb64, $signb64) = $tks;
$header = $this->jsonDecode ($this->urlsafeB64Decode ($headerb64));
$header = (object)$this->jsonDecode ($this->urlsafeB64Decode ($headerb64));
$payload = $this->urlsafeB64Decode ($payloadb64);
if ($ckey)
$payload = $this->decrypt ($payload, $ckey);
@@ -291,7 +291,7 @@ class jwt
private function jsonDecode ($input)
// {{{
{
return json_decode ($input, false, 512, JSON_BIGINT_AS_STRING);
return json_decode ($input, true, 512, JSON_BIGINT_AS_STRING);
}
// }}}
}