-
Notifications
You must be signed in to change notification settings - Fork 1
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
userFromToken 无法使用 #12
Labels
enhancement
New feature or request
Comments
看了下 laravel 文档:https://laravel.com/docs/6.0/socialite#retrieving-user-details 当有 token 时,可以去查询用户资料:
而本 package 未实现这一点,只实现了 登录时获取用户资料。 |
看了下 GitHub、Facebook、Google 的 API,获取用户资料都是根据 token 即可,而不需要 user id。微信又破坏标准了……需要 HACK @apollopy |
sinkcup
added a commit
that referenced
this issue
Sep 4, 2019
sinkcup
added a commit
that referenced
this issue
Sep 4, 2019
sinkcup
added a commit
that referenced
this issue
Sep 4, 2019
sinkcup
added a commit
that referenced
this issue
Sep 4, 2019
sinkcup
added a commit
that referenced
this issue
Sep 6, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@apollopy 提出:
sinkcup/sinkcup.github.io#12 (comment)
由于微信并不能光用 token 拿到用户信息,还需要传递 openid。原包里
https://github.com/SocialiteProviders/Providers/blob/master/src/Weixin/Provider.php#L133
https://github.com/SocialiteProviders/Providers/blob/master/src/Weixin/Provider.php#L30-L33
这两段,保证了我既能用过 user() 函数直接实现。也能在已知 openid 和 token 的情况下,自己 new 这个类,通过 userFromToken 拿到 Laravel\Socialite\AbstractUser
而 credentialsResponseBody 目前是没办法在外部设置的。导致抽象类里的 https://github.com/laravel/socialite/blob/4.0/src/Two/AbstractProvider.php#L230
作为一个 public 函数,完全没办法使用
The text was updated successfully, but these errors were encountered: