agario-client
agario-client copied to clipboard
Unable to get facebook token via account.js
Hey,
I'm testing around with account.js to get a facebook token. I got the cookies from my friend (datr, c_user & xs) but I'm not receiving an error which should (or could) be called here: req.on('error', function(e) { ret.error = e; if(cb) cb(null, ret); }); and I'm not receiving any token.
I tried to debug it but parsed_token was never send. Tested with:
if(res && res.headers && res.headers.location) {
res.headers.location.replace(/access_token=([a-zA-Z0-9-_]*)&/, function(_, parsed_token) {
if(parsed_token) {
account.token = parsed_token;
account.token_provider = 1;
}
console.log("Parsed_token",parsed_token);
});
res.headers.location.replace(/expires_in=([0-9]*)/, function(_, expire) {
if(expire) {
account.token_expire = (+new Date) + expire*1000;
}
});
}
EXTRA: I'm unable to find my datr cookie. I only have c_user & xs! Anyone know why?
Thanks for your test.
I'm receiving this message:
Failed to get token!
HTTP code: 302 Redirect: https://www.facebook.com/login.php?skip_api_login=1&api_key=677505792353827&signed_next=1&next=https%3A%2F%2Fwww.facebook.com%2Fv2.3%2Fdialog%2Foauth%3Fredirect_uri%3Dhttps%253A%252F%252Fagar.io%26scope%3Dpublic_profile%252C%2Bemail%26response_type%3Dtoken%26client_id%3D677505792353827%26ret%3Dlogin&cancel_url=https%3A%2F%2Fagar.io%2F%3Ferror%3Daccess_denied%26error_code%3D200%26error_description%3DPermissions%2Berror%26error_reason%3Duser_denied%23_%3D_&display=page&locale=fr_FR
Where do you got your datr cookie from? I'm using google chrome but I'm not seeing the datr cookie in my 'cookie explorer'
@agarmaster1987
Try to open https://www.facebook.com or http://www.facebook.com
I know there is www used, maybe it will help.
Found the issue. In my country (tested it with 3 friends) is the datr cookie called lu. I don't know why and I'm not wuite sure.
Can anybody confirm that xs is renamed sometimes? Should we add this to readme?
@MasonBurdette
Does it have name lu or it can be completely random?