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");