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

Bypass auth screen if we already have a token #199

Merged
merged 3 commits into from
Nov 22, 2016

Conversation

themsaid
Copy link
Member

In reference to #16

This PR skips the approval screen if the user has a valid token for the same client that has the same scope as the scope requested, Passport will auto-approve the request and return a new token.

return $client->tokens()
->whereUserId($user->id)
->whereRevoked(0)
->where('expires_at', '>', Carbon::now()->toDateTimeString())
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure you really need to make a string, you can just pass in the Carbon instance.

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated.

@taylorotwell taylorotwell merged commit 917774b into laravel:1.0 Nov 22, 2016
@jbrooksuk
Copy link
Member

Yay! Thanks for this @themsaid!

@themsaid
Copy link
Member Author

@jbrooksuk welcome :)

@raftalks
Copy link
Contributor

raftalks commented Feb 9, 2017

@themsaid is this no longer supported on latest version?

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.

4 participants