Open paulroth3d opened 1 year ago
Otherwise, for anyone else running into this,
look in the node_modules/apple-icloud/main.js
and change this:
// Now, validate the session with checking for important aspects that show that the session can be used to get data (e.g. there need to be a token, some cookies and account info)
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);
})();
into this:
// Now, validate the session with checking for important aspects that show that the session can be used to get data (e.g. there need to be a token, some cookies and account info)
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) : false));
})();
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: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:
https://github.com/MauriceConrad/iCloud-API/issues/64 https://github.com/MauriceConrad/iCloud-API/issues/71 https://github.com/MauriceConrad/iCloud-API/issues/53 https://github.com/MauriceConrad/iCloud-API/issues/47
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 theself.login
on line 162 never fires.Could you please release a new version to npm?