From 5ba79a6ae2e30b249f7ce4b83c67b5c953416da4 Mon Sep 17 00:00:00 2001 From: Dominique Fournier Date: Thu, 5 Dec 2019 09:59:34 +0000 Subject: [PATCH] authjwt : as jwt return an object, must cast the result as array git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@5789 bf3deb0d-5f1a-0410-827f-c0cc1f45334c --- authjwt.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/authjwt.php b/authjwt.php index bed115a..e21873e 100644 --- a/authjwt.php +++ b/authjwt.php @@ -61,7 +61,7 @@ class authjwt extends auth // The JWT was tested in authparams. End of process if (! empty ($payload)) { - $this->payload = $payload; + $this->payload = (array)$payload; $this->payload["bearer"] = substr ($_SERVER["HTTP_AUTHENTICATION"], 7); } if (! key_exists ("email", $this->payload)) @@ -71,7 +71,7 @@ class authjwt extends auth /** Return all the parameters recorded for the authenticate user */ public function getdetails () { - if ($this->payload === null) + if ($this->payload["email"] === "anonymous") return array ("lastname" => "anonymous", "firstname" => "", "email" => "anonymous");