Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
miladrahimi authored Nov 23, 2023
1 parent 213fca9 commit b77bea8
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,10 @@ $signer = new HS256('12345678901234567890123456789012');
// Extend the DefaultValidator
$validator = new DefaultValidator();

// The presence of the 'is-admin' claim is mandatory for successful validation. If absent, the validation will fail.
// Additionally, if the rule does not match the corresponding value, the validation will also fail.
// The 'is-admin' claim is required, without it or a mismatched rule, validation fails.
$validator->addRequiredRule('is-admin', new EqualsTo(true));

// The 'exp' claim is optional, and the rule will be applicable only if it is present.
// The 'exp' claim is optional, and the rule will be applicable if it is present.
$validator->addOptionalRule('exp', new NewerThan(time()), false);

// Parse the token
Expand Down

0 comments on commit b77bea8

Please sign in to comment.