Description
TLDR; @MauriceConrad - can you please release a new version - as there is a bug on main.js:113 that is fixed in the repo - BUT NOT if anyone npm installs..
There is a bug in main.js:113
it seems it is FIXED in the repository, BUT NOT IN npm.
This is what you get on line 113 if you install apple-icloud
npm install --save apple-icloud
look at node_modules/apple-icloud/main.js
, and you get this:
self.loggedIn = (function() {
//console.log(self.auth.cookies.length > 0, !!self.auth.token, self.account != {}, self.username === username);
return (self.auth.cookies.length > 0 && self.auth.token && self.account != {} && username ? (self.username === username) : true);
})();
note the final condition: && username ? (self.username === username) : true
this is wrong and needs to be: && (username ? (self.username === username) : false));
(missing the parentheses around the check - bypassing the && operator, and almost always returning true)
This appears fixed in the git repository
https://github.com/MauriceConrad/iCloud-API/blob/master/main.js#L115
This is actually the source of a NUMBER of issues:
and many others.
These - and many others - all come from myCloud.account
being an empty object, and therefore none of the apis can be called.
The reason it is empty is because self.loggedIn
is setting to true, and therefore the self.login
on line 162 never fires.
Could you please release a new version to npm?