-
Notifications
You must be signed in to change notification settings - Fork 783
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
Auth driver [passport] for guard [api] is not defined. after updating #1118
Comments
Same issue here. Versions: During debugging I also find that the closure in registerGuard() is not getting executed. |
This is related to #1003 I believe. Ping @crynobone |
Need more information. All the code are executed on |
public static function resolved(Closure $callback)
{
$accessor = static::getFacadeAccessor();
if (!! static::$app->resolved($accessor)) {
$callback(static::getFacadeRoot());
}
static::$app->afterResolving($accessor, function ($service) use ($callback) {
$callback($service);
});
} A solution is to add |
@crynobone okay. Can you maybe PR that to the framework? |
@crynobone thanks! |
PR was merged. We can try this out tomorrow when the next framework version is released. |
@Garanaw can you try again with the latest Laravel release? |
@driesvints @crynobone |
Great! |
Description:
After updating Laravel from 5.8 to 6.5 and Passport from 7.2 to 8.0, this message appears, no configuration has changed, nor anything that might affect the functioning of Passport.
Steps To Reproduce:
Config file
Stack Trace
Aditional info
At the moment of updating Passport to 8.0, I had a look to my vendor folder and compared it to the repo and the last commits. I could notice that the exception
src\Exceptions\OAuthServerException
was missing, so I deleted the folder and reinstalled it using the last version to make sure everything loads fine. Still, this happened after getting the error, so should not be related, but something to let you know I think.Not sure if the error is due to a service provider not registering the guard properly or if it comes from another piece of code, but as mentioned previously, my
auth.php
config file has always been the same, and it worked previous to the update--- EDIT ---
More info
After debugging the project, I realized that the method
registerGuard
in the PassportServiceProvider class is called, but the closure to register the guard is never executed. The method:--- EDIT 2 ---
Workaround
In order to make the closure being executed, I have overriden the original
registerGuard
method as follows, and it seems to work without issues:config/app.php
The text was updated successfully, but these errors were encountered: