Skip to content

Commit 5df90c9

Browse files
committed
Fixed nonce expiry example
With the existing example, nonces can be  re-used for five minutes and then expire, which is the reverse of the desired effect.
1 parent 7aa023d commit 5df90c9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cookbook/security/custom_authentication_provider.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ the ``PasswordDigest`` header value matches with the user's password.
226226
}
227227
228228
// Validate nonce is unique within 5 minutes
229-
if (file_exists($this->cacheDir.'/'.$nonce) && file_get_contents($this->cacheDir.'/'.$nonce) + 300 < time()) {
229+
if (file_exists($this->cacheDir.'/'.$nonce) && file_get_contents($this->cacheDir.'/'.$nonce) + 300 > time()) {
230230
throw new NonceExpiredException('Previously used nonce detected');
231231
}
232232
file_put_contents($this->cacheDir.'/'.$nonce, time());

0 commit comments

Comments
 (0)