-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
用户授权出现The key "access_token" could not be empty #527
Comments
我也遇到了这个情况,我用的中间件,应该是用户在授权失败页面刷新导致的。 |
那是错误的使用啊,授权失败就不应该刷新啊,那我也解决不了啊 |
应该不是重复刷新导致的。 可还是会出现这错误 |
我也出现,并非授权失败。 环境:SwooleFramework,PHP 7.09 此为bug~ |
@iScript @Sunappnio @xiaohuilam 请更新版本: $ composer update overtrue/socialite -vvv |
我看了下请求微信的日志,code倒是每次都有带的, 不知道是不是微信有时会2次redirect回来的原因。有什么好的解决办法。。 |
我用的环境
PHP 版本:7
overtrue/wechat 版本:3.1
问题及现象
[2016-11-22 00:00:32] local.ERROR: InvalidArgumentException: The key "access_token" could not be empty. in /home/www/wt-game/vendor/overtrue/socialite/src/AccessToken.php:33
平常测试基本没出现,都能正常运行。但每天看laravel的错误日志都有几千条这样的错误日志。
都是同一个方法里的, 以下是详细错误日志:
[2016-11-22 00:25:31] local.ERROR: InvalidArgumentException: The key "access_token" could not be empty. in /home/www/wt-game/vendor/overtrue/socialite/src/AccessToken.php:33
Stack trace:
#0 /home/www/wt-game/vendor/overtrue/socialite/src/Providers/WeChatProvider.php(163): Overtrue\Socialite\AccessToken->__construct(Array)
#1 /home/www/wt-game/vendor/overtrue/socialite/src/Providers/WeChatProvider.php(155): Overtrue\Socialite\Providers\WeChatProvider->parseAccessToken('{"errcode":4002...')
#2 /home/www/wt-game/vendor/overtrue/socialite/src/Providers/AbstractProvider.php(173): Overtrue\Socialite\Providers\WeChatProvider->getAccessToken('001ipbjl0ejsh52...')
#3 /home/www/wt-game/app/Http/Controllers/WechatController.php(35): Overtrue\Socialite\Providers\AbstractProvider->user()
#4 [internal function]: App\Http\Controllers\WechatController->callback()
#5 /home/www/wt-game/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(55): call_user_func_array(Array, Array)
#6 /home/www/wt-game/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(44): Illuminate\Routing\Controller->callAction('callback', Array)
#7 /home/www/wt-game/vendor/laravel/framework/src/Illuminate/Routing/Route.php(189): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(App\Http\Controllers\WechatController), 'callback')
#8 /home/www/wt-game/vendor/laravel/framework/src/Illuminate/Routing/Route.php(144): Illuminate\Routing\Route->runController()
#9 /home/www/wt-game/vendor/laravel/framework/src/Illuminate/Routing/Router.php(642): Illuminate\Routing\Route->run(Object(Illuminate\Http\Request))
#10 /home/www/wt-game/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Routing\Router->Illuminate\Routing{closure}(Object(Illuminate\Http\Request))
#11 /home/www/wt-game/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(41): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request))
#12 /home/www/wt-game/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(137): Illuminate\Routing\Middleware\SubstituteBindings->handle(Object(Illuminate\Http\Request), Object(Closure))
#13 /home/www/wt-game/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(33): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#14 /home/www/wt-game/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request))
#15 /home/www/wt-game/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(137): Illuminate\View\Middleware\ShareErrorsFromSession->handle(Object(Illuminate\Http\Request), Object(Closure))
#16 /home/www/wt-game/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(33): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
The text was updated successfully, but these errors were encountered: