ptbrowne / whispersync-lib

Access Amazon's whispersync API for Kindle
34 stars 2 forks source link

Authentication error not caught and leads to xmldom error loop #23

Open KudMath opened 3 years ago

KudMath commented 3 years ago

I'm getting an xmldom error when registering a new device. [xmldom error] element parse error: TypeError: source.indexOf is not a function @#[line:0,col:undefined]

ptbrowne commented 3 years ago

Hey, I haven't quite the necessary bandwidth to look at this at the moment, are you able to reproduce easily ? I think the best way to debug this would be to add logs in this file : https://github.com/ptbrowne/whispersync-lib/blob/b9252c430bd3892a7641f9ee6e220d3e84f88b97/whispersync-client/src/parse.js#L62 ?

Tell me if you succeed and what kind of register response you receive (the raw xmlText that is received in parseRegisterResponse). Thanks !

nebriv commented 1 year ago

@KudMath not sure if I'm having the same issue as you - but this is what the XML response is that I'm getting:

<error><customer_not_found>No customer found for this e-mail address and password.</customer_not_found></error>

Will continue to debug and see whats up.

Edit: AHA! I got it figured out! Ok so when it fails the first password authentication, Amazon will send you a OTP to your email associated with your account. Swap your password out for this OTP token when trying to register your device and you should be good to go.

theboiledice commented 7 months ago

I too am having this issue, unfortunately @nebriv's fix is not working.

This is the xmlText: <error><customer_not_found>No customer found for this e-mail address and password.</customer_not_found></error>