Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
fixing typo on JWT Decode parameter from $payload to $jwt
  • Loading branch information
SySafarila authored Jun 23, 2024
1 parent 500501c commit 090bef1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ $jwks = ['keys' => []];

// JWK::parseKeySet($jwks) returns an associative array of **kid** to Firebase\JWT\Key
// objects. Pass this as the second parameter to JWT::decode.
JWT::decode($payload, JWK::parseKeySet($jwks));
JWT::decode($jwt, JWK::parseKeySet($jwks));
```

Using Cached Key Sets
Expand Down Expand Up @@ -349,7 +349,7 @@ use InvalidArgumentException;
use UnexpectedValueException;

try {
$decoded = JWT::decode($payload, $keys);
$decoded = JWT::decode($jwt, $keys);
} catch (InvalidArgumentException $e) {
// provided key/key-array is empty or malformed.
} catch (DomainException $e) {
Expand Down Expand Up @@ -379,7 +379,7 @@ like this:
use Firebase\JWT\JWT;
use UnexpectedValueException;
try {
$decoded = JWT::decode($payload, $keys);
$decoded = JWT::decode($jwt, $keys);
} catch (LogicException $e) {
// errors having to do with environmental setup or malformed JWT Keys
} catch (UnexpectedValueException $e) {
Expand All @@ -394,7 +394,7 @@ instead, you can do the following:

```php
// return type is stdClass
$decoded = JWT::decode($payload, $keys);
$decoded = JWT::decode($jwt, $keys);

// cast to array
$decoded = json_decode(json_encode($decoded), true);
Expand Down

0 comments on commit 090bef1

Please sign in to comment.