We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
isNewSession等于true时,直接return 走了,Event::fire(new WeChatUserAuthorized(session('wechat.oauth_user'), $isNewSession));这里的isNewSesssion 永远不可能为true
The text was updated successfully, but these errors were encountered:
@boywangxj 嗯,这块确实不正确,我需要修改一下。
Sorry, something went wrong.
其实单从这个事件定义的名称WeChatUserAuthorized来看,直接在用户通过授权后的处理代码中触发这个事件就可以了,也不需要$isNewSession这个变量,代码也更清晰简单,不知道我这样理解对不对,或者有我没有考虑到的使用情景。 if ($request->has('state') && $request->has('code')) { session(['wechat.oauth_user' => $this->wechat->oauth->user()]); Event::fire(new WeChatUserAuthorized(session('wechat.oauth_user'))); return redirect()->to($this->getTargetUrl($request)); }
isNewSession 表示是第一次授权, session 没过期之前的后续所有授权都不是第一次
No branches or pull requests
isNewSession等于true时,直接return 走了,Event::fire(new WeChatUserAuthorized(session('wechat.oauth_user'), $isNewSession));这里的isNewSesssion 永远不可能为true
The text was updated successfully, but these errors were encountered: