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

Avoid accessing Token class directly #95

Closed
lucasctd opened this issue Feb 13, 2019 · 1 comment · Fixed by #173
Closed

Avoid accessing Token class directly #95

lucasctd opened this issue Feb 13, 2019 · 1 comment · Fixed by #173

Comments

@lucasctd
Copy link

lucasctd commented Feb 13, 2019

In AccessTokenController class you access the Token model directly (see below). You should avoid doing this since Laravel provides the Passport::token() where you can get the instance of the Token model.
image
So, instead of doing like above you should:

$query = Passport::token()->where('user_id', $token->user_id)->where('client_id', $token->client_id);
It's very important since, like in my case, people may be using a different implementation of the model.

@lucasctd
Copy link
Author

I have opened a the #96 PR with the updated code. =D

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 a pull request may close this issue.

1 participant