File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -173,11 +173,10 @@ $signer = new HS256('12345678901234567890123456789012');
173
173
// Extend the DefaultValidator
174
174
$validator = new DefaultValidator();
175
175
176
- // The presence of the 'is-admin' claim is mandatory for successful validation. If absent, the validation will fail.
177
- // Additionally, if the rule does not match the corresponding value, the validation will also fail.
176
+ // The 'is-admin' claim is required, without it or a mismatched rule, validation fails.
178
177
$validator->addRequiredRule('is-admin', new EqualsTo(true));
179
178
180
- // The 'exp' claim is optional, and the rule will be applicable only if it is present.
179
+ // The 'exp' claim is optional, and the rule will be applicable if it is present.
181
180
$validator->addOptionalRule('exp', new NewerThan(time()), false);
182
181
183
182
// Parse the token
You can’t perform that action at this time.
0 commit comments