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

Token constructor method should not throw if token has expired #132

Open
NPellet opened this issue Jan 5, 2021 · 1 comment
Open

Token constructor method should not throw if token has expired #132

NPellet opened this issue Jan 5, 2021 · 1 comment
Labels

Comments

@NPellet
Copy link

NPellet commented Jan 5, 2021

So I'm struggling a bit with the general workflow.

I'm trying to recreate the AccessToken from my PHP Session, but when the token is expired, the constructor throws a JWT\ExpiredException

which means I don't have access to the the hasExpired() method, and therefore also not to the refresh token.
I can get it from the raw data, but if the implementation of the structure changes my code will break.

IMHO the constructor should not throw when the token is expired.

@NPellet NPellet changed the title Token should not throw is expired in its constructor Token constructor method should not throw if token has expired Jan 5, 2021
@hajekj hajekj added the bug label Jun 23, 2022
@hajekj
Copy link
Member

hajekj commented Jun 23, 2022

I agree that this is definitely incorrect behavior and quite unfortunate. This change would require quite a complex change in the token validation scenario when you receive the token as a result of authorization flow. I will try to look into the ways to improve this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants