I have created a custom Auth Guard in Laravel. But whenever I run a command with Artisan I get the following error: sentry.breadcrumbs error=Auth guard driver [wamp] is not defined.
When I run my queue it just keeps spamming that error over and over.
I'm pretty sure the guard is defined in my AuthServiceProvider:
/**
* Register any authentication / authorization services.
*
* @return void
*/
public function boot()
{
$this->registerPolicies();
$this->registerTokensGuard();
$this->registerWampUserProvider();
}
/**
* Register the custom tokens guard.
*
* @return void
*/
private function registerTokensGuard()
{
Auth::extend('tokens', function ($app, $name, array $config) {
return new TokensGuard(
Auth::createUserProvider($config['provider']),
$app['request']
);
});
}
/**
* Register the WAMP user provider.
*
* @return void
*/
private function registerWampUserProvider()
{
Auth::provider('wamp', function ($app, array $config) {
return new WampUserProvider(
$app['hash'],
$config['model'],
$config['tokens']
);
});
}
Any known problems here?
In your config/app.php do you happen to have the AuthServiceProvider below the Sentry one?
If that is the case, switch them around ;) The auth provider really is not loaded yet.
Closing this because it's probably fixed some way or another by now.
If you are still having issues feel free to reopen!
Most helpful comment
In your
config/app.phpdo you happen to have theAuthServiceProviderbelow the Sentry one?If that is the case, switch them around ;) The auth provider really is not loaded yet.