404labfr / 404labfr/laravel-impersonate

Package seems not to work with Sanctum / Laravel 9?

未关闭
#156 19 条评论 3 个 reaction 已指派 0 人 在 GitHub 查看
possible bug
主要语言
PHP
星标
2.3k
派生
235
PR 合并指标
30 天内没有已合并 PR

描述

Hi there guys,

I have some really weird issue implementing this package in a project of mine. This is weird, since I have two other projects with this package working.

The error I am receiving when installing this package is:

```
InvalidArgumentException : Auth driver [sanctum] for guard [sanctum] is not defined.
/project/vendor/laravel/framework/src/Illuminate/Auth/AuthManager.php:117
/project/vendor/laravel/framework/src/Illuminate/Auth/AuthManager.php:76
/project/vendor/laravel/sanctum/src/Sanctum.php:68
```

I have done some digging and found out that the `sanctum` driver is missing in the `customCreators` property of `AuthManager`. When I disable the `ImpersonateServiceProvider::registerAuthDriver` method, my tests run perfectly, but impersonation doesn't work. I see that the `sanctum` driver is visible in the `customCreators` property of `AuthManager`.

I am not a specialist in the authentication system of Laravel, so I don't have any clue why this is happening.

Do you have any direction for me to dig further?

Regards, Bob

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。