laravel / passport

Laravel Passport provides OAuth2 server support to Laravel.
https://laravel.com/docs/passport
MIT License
3.25k stars 780 forks source link

Error Method Laravel\Passport\Guards\TokenGuard::attempt does not exist When using 'api' guard #1681

Closed Mohdk911 closed 10 months ago

Mohdk911 commented 10 months ago

Passport Version

11.8.8

Laravel Version

10.19.0

PHP Version

8.1.22

Database Driver & Version

MySQL 8.0.34, SQLite 3

Description

Error Method Laravel\Passport\Guards\TokenGuard::attempt does not exist when use Passport::actingAs with 'api' guard when do login user via Auth::attempt()

Steps To Reproduce

Error Method Laravel\Passport\Guards\TokenGuard::attempt does not exist when use Passport::actingAs with 'api' guard when do login user via Auth::attempt()

crynobone commented 10 months ago

\ Hi there,

Thanks for reporting the problem you are encountering, but it looks like this is a question which may be better suited for a support channel. We only use this issue tracker for reporting bugs with the library itself. If you have a question on how to use functionality provided by this repository you can try one of the following channels:

However, this issue will not be locked and everyone is still free to discuss solutions to your problem!

Thanks.

Mohdk911 commented 10 months ago

@crynobone But it seems that it's a bug with the library it self since it's working with guard 'web' but it's not working with guard 'api'

crynobone commented 10 months ago

What you describe is the expected behaviour, you can learn more by asking in any support channels as suggested.