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

[10.x] Cache tokens to prevent unnecessary queries #1368

Closed
wants to merge 4 commits into from

Conversation

Jefemy
Copy link

@Jefemy Jefemy commented Oct 13, 2020

Fixes #382 by storing the tokens in memory after first retrieval. This is the only direct passport fix as the other queries come from league/oauth2-server and can't be stopped without passing the tokens around like with this.
It also removes the check for revoked client since the server already checks for it.

  • Improve the way the service provider serves the same TokenRepository
  • Add cacheing to the rest of the functions in the TokenRepository

return (new TokenGuard(
$this->app->make(ResourceServer::class),
new ResourceServer(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will break apps that are overriding this class.

if ($this->clients->revoked($clientId)) {
return;
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a breaking change.

@driesvints
Copy link
Member

Seems like there are still some fundamental breakages in this PR. Feel free to reattempt it when you've solved them. Thanks.

@driesvints driesvints closed this Oct 19, 2020
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.

TokenGuard query token twice
2 participants