近期捣鼓网站的composer 突然overtrue/socialite 登录报错了,排查了好久:
报错代码:
$socialite = new SocialiteManager($this->config);
$user = $socialite->driver('qq')->user();
这里的user授权的时候状态码会出问题,这里排查半天后面查到了,需要在user前面添加这个
->stateless()
个方法就可以了,
正常代码:
$socialite = new SocialiteManager($this->config);
$user = $socialite->driver('qq')->stateless()->user();
这样就能正常获取返回的数据:之前升级composer的包了,又降级了,后面又更新了库,由此可得,没事别乱升级composer,更新composer。
推荐