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

Api guard is hardcoded #1094

Closed
YWatchman opened this issue Oct 21, 2019 · 1 comment
Closed

Api guard is hardcoded #1094

YWatchman opened this issue Oct 21, 2019 · 1 comment

Comments

@YWatchman
Copy link

  • Passport Version: *
  • Laravel Version: 5.8^
  • PHP Version: 7.3
  • Database Driver & Version: MariaDB 10.2

Description:

The api guard is hardcoded in some spots (https://github.com/laravel/passport/blob/7.0/src/Token.php#L80), this wasted +/- 2 hours of my time figuring out why I can't use 2 guards (userapi and frontendapi). I renamed my frontendapi guard back to api.

Steps To Reproduce:

  1. Add another guard, for example 'frontendapi' and set the driver to passport
  2. Assign the guard through a middleware
  3. Try to authenticatie, response will be that you stay unauthenticated. This is because Passport is explicitly searching for the 'api' guard. that makes that the middleware 'auth:guard' doesn't have any impact.
@driesvints
Copy link
Member

Atm this isn't a problem because Passport doesn't implement multi auth. But this will indeed need to be made configurable if multi auth is to be supported. Please see #982

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