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');
173173// Extend the DefaultValidator
174174$validator = new DefaultValidator();
175175
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.
178177$validator->addRequiredRule('is-admin', new EqualsTo(true));
179178
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.
181180$validator->addOptionalRule('exp', new NewerThan(time()), false);
182181
183182// Parse the token
You can’t perform that action at this time.
0 commit comments