Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow setting the "exp" claim from event listeners #503

Merged
merged 1 commit into from
Oct 6, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Allow setting the "exp" claim from event listeners
MaximeMaillet authored and chalasr committed Oct 5, 2018

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit e3a000f5a2285d185c46145c370af2708934ecf8
2 changes: 1 addition & 1 deletion Services/JWSProvider/DefaultJWSProvider.php
Original file line number Diff line number Diff line change
@@ -89,7 +89,7 @@ public function create(array $payload, array $header = [])
$jws = new JWS($header, $this->cryptoEngine);
$claims = ['iat' => time()];

if (null !== $this->ttl) {
if (null !== $this->ttl && !isset($payload['exp'])) {
$claims['exp'] = time() + $this->ttl;
}

2 changes: 1 addition & 1 deletion Services/JWSProvider/LcobucciJWSProvider.php
Original file line number Diff line number Diff line change
@@ -80,7 +80,7 @@ public function create(array $payload, array $header = [])
}
$jws->setIssuedAt(time());

if (null !== $this->ttl) {
if (null !== $this->ttl && !isset($payload['exp'])) {
$jws->setExpiration(time() + $this->ttl);
}