Skip to content

Commit

Permalink
Fix bug with data type in JWT claims using FirebaseClient (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
spvickers committed Apr 4, 2022
1 parent a06aacf commit ab1e3f2
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/Jwt/ClientInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public function hasClaim($name);
* @param string $name Claim name
* @param string $defaultValue Default value
*
* @return string The value of the claim with the specified name, or the default value if it does not exist
* @return string|array|object The value of the claim with the specified name, or the default value if it does not exist
*/
public function getClaim($name, $defaultValue = null);

Expand Down
5 changes: 1 addition & 4 deletions src/Jwt/FirebaseClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ public function hasClaim($name)
* @param string $name Claim name
* @param string $defaultValue Default value
*
* @return string|array The value of the claim with the specified name, or the default value if it does not exist
* @return string|array|object The value of the claim with the specified name, or the default value if it does not exist
*/
public function getClaim($name, $defaultValue = null)
{
Expand All @@ -177,9 +177,6 @@ public function getClaim($name, $defaultValue = null)
} else {
$value = $defaultValue;
}
if (is_object($value)) {
$value = (array) $value;
}

return $value;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Jwt/SpomkyLabsClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ public function hasClaim($name)
* @param string $name Claim name
* @param string $defaultValue Default value
*
* @return string The value of the claim with the specified name, or the default value if it does not exist
* @return string|array|object The value of the claim with the specified name, or the default value if it does not exist
*/
public function getClaim($name, $defaultValue = null)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Jwt/WebTokenClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ public function hasClaim($name)
* @param string $name Claim name
* @param string $defaultValue Default value
*
* @return string The value of the claim with the specified name, or the default value if it does not exist
* @return string|array|object The value of the claim with the specified name, or the default value if it does not exist
*/
public function getClaim($name, $defaultValue = null)
{
Expand Down

0 comments on commit ab1e3f2

Please sign in to comment.