{"action":"created","issue":{"url":"https://api.github.com/repos/hhxsv5/laravel-s/issues/25","repository_url":"https://api.github.com/repos/hhxsv5/laravel-s","labels_url":"https://api.github.com/repos/hhxsv5/laravel-s/issues/25/labels{/name}","comments_url":"https://api.github.com/repos/hhxsv5/laravel-s/issues/25/comments","events_url":"https://api.github.com/repos/hhxsv5/laravel-s/issues/25/events","html_url":"https://github.com/hhxsv5/laravel-s/issues/25","id":310439467,"number":25,"title":"Laravel passport  配置参数污染问题","user":{"login":"glzjin","id":7975407,"avatar_url":"https://avatars0.githubusercontent.com/u/7975407?v=4","gravatar_id":"","url":"https://api.github.com/users/glzjin","html_url":"https://github.com/glzjin","followers_url":"https://api.github.com/users/glzjin/followers","following_url":"https://api.github.com/users/glzjin/following{/other_user}","gists_url":"https://api.github.com/users/glzjin/gists{/gist_id}","starred_url":"https://api.github.com/users/glzjin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/glzjin/subscriptions","organizations_url":"https://api.github.com/users/glzjin/orgs","repos_url":"https://api.github.com/users/glzjin/repos","events_url":"https://api.github.com/users/glzjin/events{/privacy}","received_events_url":"https://api.github.com/users/glzjin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2018-04-02T09:26:50Z","updated_at":"2018-04-25T13:58:24Z","closed_at":null,"author_association":"NONE","body":"一开始是页面会莫名的退出登录，然后再次尝试登录的时候就出错了。查看日志提示是 AuthManager  的某个方法未定义。\r\n\r\nMethod attempt does not exist. {“exception”:”[object] (BadMethodCallException(code: 0): Method attempt does not exist.\r\n\r\n这就有点奇怪了，明明在 php-fpm  下啥事都没有。更加邪门的是，这个在正式环境下才有问题，测试环境下一点问题都没有。后来仔细排查，阅读了这部分的所有相关源码之后，发现 Auth driver  加载的居然是 api 的，然而这个是 web 的路由呀。仔细追查下去，发现是 Laravel passport  在加载时改写了 config，在调用 shouldUse 方法时，如果是 api 路由，就把默认的 driver 改成他自己了，这样在 api 路由当然没问题，可老铁。。。如果处理这个请求的 Worker 后来又去请求 web 了，默认的 driver 就一直是 api 了，所以才会出现上面这种情况。\r\n\r\n知道是什么原因了，解决就好说了，把 config 给重置下，可怎么重置也略有点蛋疼。。。"},"comment":{"url":"https://api.github.com/repos/hhxsv5/laravel-s/issues/comments/384296645","html_url":"https://github.com/hhxsv5/laravel-s/issues/25#issuecomment-384296645","issue_url":"https://api.github.com/repos/hhxsv5/laravel-s/issues/25","id":384296645,"user":{"login":"glzjin","id":7975407,"avatar_url":"https://avatars0.githubusercontent.com/u/7975407?v=4","gravatar_id":"","url":"https://api.github.com/users/glzjin","html_url":"https://github.com/glzjin","followers_url":"https://api.github.com/users/glzjin/followers","following_url":"https://api.github.com/users/glzjin/following{/other_user}","gists_url":"https://api.github.com/users/glzjin/gists{/gist_id}","starred_url":"https://api.github.com/users/glzjin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/glzjin/subscriptions","organizations_url":"https://api.github.com/users/glzjin/orgs","repos_url":"https://api.github.com/users/glzjin/repos","events_url":"https://api.github.com/users/glzjin/events{/privacy}","received_events_url":"https://api.github.com/users/glzjin/received_events","type":"User","site_admin":false},"created_at":"2018-04-25T13:58:24Z","updated_at":"2018-04-25T13:58:24Z","author_association":"NONE","body":"@hhxsv5 经测试问题已经解决，辛苦了，感谢！"}}
{"actor":{"display_login":"glzjin"}}