Skip to content
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 'split' of undefined #4

Closed
laterbreh opened this issue Jul 16, 2016 · 7 comments
Closed

TypeError: Cannot read property 'split' of undefined #4

laterbreh opened this issue Jul 16, 2016 · 7 comments

Comments

@laterbreh
Copy link

Hello,

I can't seem to get passed this part of the script, any ideas? (script is untouched, just trying to run main.js):

var ticket = r.headers['location'].split("ticket=")[1]
^

TypeError: Cannot read property 'split' of undefined
at Request._callback (C:\Users\Reakt\Desktop\pokego api\Pokemon-GO-node-api\logins.js:32:51)
at Request.self.callback (C:\Users\Reakt\Desktop\pokego api\Pokemon-GO-node-api\node_modules\request\request.js:187:22)
at emitTwo (events.js:87:13)
at Request.emit (events.js:172:7)
at Request. (C:\Users\Reakt\Desktop\pokego api\Pokemon-GO-node-api\node_modules\request\request.js:1044:10)
at emitOne (events.js:77:13)
at Request.emit (events.js:169:7)
at IncomingMessage. (C:\Users\Reakt\Desktop\pokego api\Pokemon-GO-node-api\node_modules\request\request.js:965:12)
at emitNone (events.js:72:20)
at IncomingMessage.emit (events.js:166:7)

@Armax
Copy link
Owner

Armax commented Jul 16, 2016

Are your logging in with your pokemon trainer club infos? because it can't find the access token (I still have to add checks for errors)

@laterbreh
Copy link
Author

I was using the information that was already in there. I figured: "Arm4x","OHSHITWADDUP" is a dummy account that you were using for testing and that it would work.

If the case is that the login information you have in Main.js is just fake information, Ill just move ahead and try and get google auth working with the script :)

@Armax
Copy link
Owner

Armax commented Jul 16, 2016

Yeah "Arm4x","OHSHITWADDUP" is a fake credential

@Armax Armax closed this as completed Jul 16, 2016
@Armax
Copy link
Owner

Armax commented Jul 16, 2016

anyway if you want to add the google oauth by your own check logins.js

@Armax
Copy link
Owner

Armax commented Jul 16, 2016

We have error handling now thanks to @jdpnielsen

@Armax Armax closed this as completed Jul 16, 2016
@laterbreh
Copy link
Author

I am still trying to port https://github.com/Mila432/Pokemon_Go_API/blob/master/login.py#L39 to node.js. I am having trouble with the third URL post. I have opened an issue on that Git, but I'm not sure if I am in the right direction at this point. Maybe I can send you my code snippet?

@Armax
Copy link
Owner

Armax commented Jul 16, 2016

Yeah, join me at https://discord.gg/7Mgma private message to @Arm4x

@Armax Armax reopened this Jul 16, 2016
@Armax Armax closed this as completed Jul 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants