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

Conversation

MaximeMaillet
Copy link
Contributor

Related in #441

@sinner
Copy link

sinner commented Jul 11, 2018

I have the same problem... Could you accept this PR?

@chalasr
Copy link
Collaborator

chalasr commented Jul 11, 2018

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.

Copy link
Collaborator

@chalasr chalasr left a 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;
Copy link
Collaborator

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

@chalasr
Copy link
Collaborator

chalasr commented Sep 15, 2018

ping @MaximeMaillet :)

@chalasr chalasr force-pushed the issues-441 branch 3 times, most recently from c22f42c to df16d4b Compare October 5, 2018 19:35
@chalasr chalasr changed the title TTL does not working Allow setting the "exp" claim from event listeners Oct 5, 2018
@chalasr
Copy link
Collaborator

chalasr commented Oct 6, 2018

Thank you @MaximeMaillet.

@chalasr chalasr merged commit e3a000f into lexik:master Oct 6, 2018
chalasr added a commit that referenced this pull request Oct 6, 2018
…meMaillet)

This PR was merged into the 2.x-dev branch.

Discussion
----------

Allow setting the "exp" claim from event listeners

Related in [#441](#441)

Commits
-------

e3a000f Allow setting the "exp" claim from event listeners
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants