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

[bug]2个问题 #597

Closed
zhangmazi opened this issue Feb 20, 2017 · 5 comments
Closed

[bug]2个问题 #597

zhangmazi opened this issue Feb 20, 2017 · 5 comments

Comments

@zhangmazi
Copy link

我用的环境

PHP 版本:7.0.13
overtrue/wechat 版本:3.2.5
Laravel版本:5.1

问题及现象

二维码扫描登录,跳转后会报nginx 502错误。 大概分析了一下。在类OAuthAuthenticate->handle内,只要用了redirect()->to是不能提前session存储的,比如后面用with,这样不会报错502
其次,AbstractProvider->user()和WeChatProvider->user()2个重复调用,异味这第2次获取accesstoken所需要的code已经无效了。

@overtrue
Copy link
Collaborator

  1. 请证明:只要用了redirect()->to是不能提前session存储的
  2. 哪里来的 AbstractProvider->user()和WeChatProvider->user()2个重复调用 ?

@zhangmazi
Copy link
Author

用源码 https://github.com/summerblue/phphub5 加入laravel-wechat组件后,出现这样的情况

@overtrue
Copy link
Collaborator

@zhangmazi 情况呢?什么情况啊?你如何证明我上面的两个疑问的?

@zhangmazi
Copy link
Author

用Log::debug调试,看日志发现的。
第2个问题,准确是WeChatProvider->user()这个方法调用了2次。
502的问题,也许跟session没有关系,我现在不能断定

@overtrue
Copy link
Collaborator

@zhangmazi WeChatProvider->user() 不会被调用两次,没有理由会调用两次,当然了你的中间件或者控制器来调用两次我就不晓得了,反正 SDK 内部不会这么干

@overtrue overtrue closed this as completed Mar 3, 2017
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

2 participants