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

Error INVALID PARAMS on UserLoginRequest #17

Closed
jensjakob opened this issue Aug 30, 2017 · 3 comments
Closed

Error INVALID PARAMS on UserLoginRequest #17

jensjakob opened this issue Aug 30, 2017 · 3 comments

Comments

@jensjakob
Copy link
Owner

jensjakob commented Aug 30, 2017

do login
UserLoginRequest
{ status: '-5256', message: 'INVALID PARAMS' }
/home/ubuntu/charge-cheap/index.js:191
                        sessionid = encodeURIComponent(json.vehicleInfo[0].custom_sessionid)
                                                                       ^

TypeError: Cannot read property '0' of undefined
do login
UserLoginRequest
{ status: '-2001', message: 'INVALID PARAMS' }
/home/ubuntu/charge-cheap/index.js:191
                        sessionid = encodeURIComponent(json.vehicleInfo[0].custom_sessionid)
                                                                       ^

TypeError: Cannot read property '0' of undefined
@jensjakob jensjakob changed the title Error 2001 on UserLoginRequest Error on UserLoginRequest Sep 1, 2017
@jensjakob jensjakob changed the title Error on UserLoginRequest Error INVALID PARAMS on UserLoginRequest Sep 1, 2017
@jensjakob
Copy link
Owner Author

+1

@samuelmr
Copy link

On line 280 your json can be null:

let json = respData && respData.length ? JSON.parse(respData) : null

If it is null, you get the error on line 191.

@jensjakob
Copy link
Owner Author

The problem was that my userid became "root" when I ran the script with sudo.

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