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

Auth driver [jwt] for guard [api] is not defined. #56

Open
balabalab opened this issue Jan 14, 2021 · 1 comment
Open

Auth driver [jwt] for guard [api] is not defined. #56

balabalab opened this issue Jan 14, 2021 · 1 comment

Comments

@balabalab
Copy link

app.php中把这个注释打开后报错,不太清楚这个逻辑,请问能讲下吗。
app('Dingo\Api\Auth\Auth')->extend('jwt', function ($app) {
return new Dingo\Api\Auth\Provider\JWT($app['Tymon\JWTAuth\JWTAuth']);
});

@balabalab
Copy link
Author

 'defaults' => [
    'guard' => env('AUTH_GUARD', 'api'),
],

'guards' => [
    'api' => [
        'driver' => 'jwt',
        'provider' => 'users',
    ],
],

'providers' => [
    'users' => [
        'driver' => 'eloquent',
        'model' => App\Models\User::class,
    ],
],

auth.php配置信息

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

1 participant