Skip to content

when return to my web app after authentication, error: Cannot set property 'accessToken'

Franklin Dong edited this page Jun 7, 2015 · 1 revision

I'm an idiot of JS by far, so I can't debug efficiently, would you please advise, thanks a lots!

###1. launch web app, and click wechat login err_step1

###2. when user click wechat_login, the browser was redirect to QR code page

err_step1

url as below: https://open.weixin.qq.com/connect/qrconnect?appid=wx11b10e757aebde2f&response_type=code&scope=snsapi_login&redirect_uri=http://foodtrust.cn /_oauth/wechat?close&state=eyJsb2dpblN0eWxlIjoicmVkaXJlY3QiLCJjcmVkZW50aWFsVG9rZW4iOiJJS1FUejc5UC1DZGVfY2p1R0hLU2Itdy1kNzBSeGVhZW1LTkx5Q1dOVFdkIiwiaXNDb3Jkb3ZhIjpmYWxzZSwicmVkaXJlY3RVcmwiOiJodHRwOi8vZm9vZHRydXN0LmNuLyJ9

###3. after QR scan, customer confirm login in his wechat client err_step1

###4. Wechat successfully authenticate this request. err_step1

###5. the browers was redirected to aplication, but not logged in err_step1

server error message as below: W20150607-15:21:16.958(8) (oauth_server.js:398) Error in OAuth Server: Cannot set property 'accessToken' of undefined I20150607-15:21:17.280(8)? Exception while invoking method 'login' TypeError: Cannot set property 'accessToken' of undefined I20150607-15:21:17.281(8)? at packages/underscore/underscore.js:848:1 I20150607-15:21:17.281(8)? at Array.forEach (native) I20150607-15:21:17.281(8)? at _.each._.forEach (packages/underscore/underscore.js:105:1) I20150607-15:21:17.281(8)? at Function._.extend (packages/underscore/underscore.js:845:1) I20150607-15:21:17.281(8)? at Object.ServiceConfiguration.configurations.findOne.service [as handleOauthRequest] (packages/leonzhang1109:accounts-wechat/wechat_server.js:9:1) I20150607-15:21:17.281(8)? at OAuth._requestHandlers.(anonymous function) (packages/oauth2/oauth2_server.js:8:1) I20150607-15:21:17.281(8)? at middleware (packages/oauth/oauth_server.js:173:1) I20150607-15:21:17.281(8)? at packages/oauth/oauth_server.js:146:1

#. my config of wechat_auth: ServiceConfiguration.configurations.insert({ service: "wechat", appId: "wx11b10e757aebde2f", scope:'basic', secret: "ef...."

BTW, in Chinese version wechat open platform setting, there's no callback url, only call back domain setting.