Skip to content

Commit 5ecee6b

Browse files
committed
Fix leeway not applied
1 parent ae42a6a commit 5ecee6b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Client.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,11 +157,13 @@ public function verify(string $token): string
157157
}
158158

159159
// Validate the token claims.
160+
$clock = \Lcobucci\Clock\SystemClock::fromUTC();
161+
$leeway = new \DateInterval('PT' . $this->leeway . 'S');
160162
$constraints = [
161163
new JwtConstraint\SignedWith(new JwtSigner\Rsa\Sha256(), $publicKey),
162164
new JwtConstraint\IssuedBy($this->broker),
163165
new JwtConstraint\PermittedFor($this->clientId),
164-
new JwtConstraint\LooseValidAt(\Lcobucci\Clock\SystemClock::fromUTC()),
166+
new JwtConstraint\LooseValidAt($clock, $leeway),
165167
];
166168
$jwt->validator()->assert($token, ...$constraints);
167169

0 commit comments

Comments
 (0)