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

Cannot set JWT leeway #1260

Open
thomasfw opened this issue Sep 4, 2024 · 1 comment
Open

Cannot set JWT leeway #1260

thomasfw opened this issue Sep 4, 2024 · 1 comment

Comments

@thomasfw
Copy link

thomasfw commented Sep 4, 2024

I'm getting a Firebase\JWT\BeforeValidException exception so I've resorted to setting JWT leeway as below, which fixes the issue:

Event::listen(function (\SocialiteProviders\Manager\SocialiteWasCalled $event) {
    \Firebase\JWT\JWT::$leeway = 60; // <----- Fix
    $event->extendSocialite('azureadb2c', \SocialiteProviders\AzureADB2C\Provider::class);
});

I've rather not use \Firebase\JWT\JWT directly as it might change depending on your implementation.

I do see some related issues (https://github.com/SocialiteProviders/Providers/issues?q=leeway) and a comment mentioning that it was fixed in #811, but I can't find the solution documented anywhere or from scanning the source code.

@atymic
Copy link
Member

atymic commented Sep 5, 2024

Feel free to PR a fix :)

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

No branches or pull requests

2 participants