-
Notifications
You must be signed in to change notification settings - Fork 51
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
TypeError: Cannot read property 'length' of undefined #30
Comments
I met the same issue.
before modify kong-oauth2-hello-world/app.js Lines 70 to 76 in 4ffe961
after modify if (json_response.data.length == 1) {
+ console.log(json_response); // print json_response, if json_response =='{"message":"not found"}', it seems your browser can't send request to kong admin api
+ application_name = json_response[name];
- application_name = json_response.data[0].name;
}
}
callback(application_name);
});
} |
you should check first if json_response.data is not undefined, before invoke length, without this, server can fail: |
Hi there,
i have tried to implement oauth2 using this repo.
Everything went well till run node application with below command
But when we hit browser below command
http://127.0.0.1:3000/authorize?response_type=code&scope=email%20address&client_id=wHsY4YI6K7gn2bYhsgPv4HB8Sw9bZ0JV
(client_id=wHsY4YI6K7gn2bYhsgPv4HB8Sw9bZ0JV : generated while creating client application)
we get this error: TypeError: Cannot read property 'length' of undefined
i have even tried this url in browser as well
http://127.0.0.1:3000/authorize?response_type=code&scope=myemail@gmail.com&client_id=wHsY4YI6K7gn2bYhsgPv4HB8Sw9bZ0JV
gettting same error.
Check below stack-trace
How to resolve this error
Thanks & regards
The text was updated successfully, but these errors were encountered: