-
-
Notifications
You must be signed in to change notification settings - Fork 612
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
Conversation
I have the same problem... Could you accept this PR? |
I'm 👍 to allow setting the exp claim (bypassing the configuration). But I think that if I set it from an event listener, I expect the value to not be changed later, I mean not adding the configured ttl. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The LcobucciJWSProvider should be updated as well
@@ -86,7 +86,7 @@ public function create(array $payload, array $header = []) | |||
$claims = ['iat' => time()]; | |||
|
|||
if (null !== $this->ttl) { | |||
$claims['exp'] = time() + $this->ttl; | |||
$payload['exp'] = (isset($payload['exp']) ? $payload['exp'] : time()) + $this->ttl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would just not touch it if it is set
ping @MaximeMaillet :) |
c22f42c
to
df16d4b
Compare
Thank you @MaximeMaillet. |
Related in #441