Pokemon-GO-node-api icon indicating copy to clipboard operation
Pokemon-GO-node-api copied to clipboard

Auto logout after some time and/or session expire?

Open sameerkanda opened this issue 8 years ago • 1 comments

Instead of calling a.init() to login, i'm doing the following:

a.playerInfo.provider = provider;
a.playerInfo.accessToken = accessToken;
a.playerInfo.apiEndpoint = apiEndpoint;

where provider, accessToken, and apiEndpoint are variables saved in a filesystem. And then I use a.setLocation to set location.

This helps restarting node without having to keep logging in (might trigger a soft ban). This works fine for a few hours, and then I start to get 'No result' error from Pokemon GO server, regardless of the api call. I'm guessing the session expired or something? Any tips regarding this?

sameerkanda avatar Jul 26 '16 20:07 sameerkanda

I solved this by checking for "No result" inside my heartbeat function and logging back in.

if(err) {
    console.log(err);
    if(err === "No result") {
        clearInterval(start);
        init();
    }
    return;
}

nathanaelnsmith avatar Jul 26 '16 23:07 nathanaelnsmith