Improve error messages for linking an anonymous auth

This commit is contained in:
Florian Bach 2021-12-14 20:05:00 +01:00
parent 732ed1cf3e
commit 2380177448

View File

@ -332,11 +332,28 @@ def convertAnonAuthToAccount(username: str, passwd: str):
err = credentialsXML.get("data") err = credentialsXML.get("data")
err_parts = err.split(' ') err_parts = err.split(' ')
if err_parts[0] == "E_AUTH_USER_ALREADY_REGISTERED": if err_parts[0] == "E_AUTH_USER_ALREADY_REGISTERED":
# This error happens when you're not using a "fresh" AdobeID.
# The AdobeID already has an UUID and authentication data, thus
# it cannot be set up using the data from the anonymous authorization.
try: try:
return False, "Can't link anon auth " + err_parts[2] + " to account, account already has user ID " + err_parts[3] return False, "Can't link anon auth " + err_parts[2] + " to account, account already has user ID " + err_parts[3]
except: except:
pass pass
elif err_parts[0] == "E_AUTH_USERID_INUSE":
# This error happens when the UUID of the anonymous auth is already
# in use by a given AdobeID.
# This can happen if you have one anonymous auth, export that,
# then convert it to AdobeID A, then re-import the backed-up anonymous auth
# (or use another computer that has the identical cloned anonymous auth)
# and then try to link that auth to another AdobeID B.
# Adobe then notices that the anonymous authorization you're trying to link
# has already been linked to an Adobe account.
try:
return False, "Can't link anon auth: Anon auth " + err_parts[3] + " has already been linked to another AdobeID"
except:
pass
return False, "Can't link anon auth to account: " + err return False, "Can't link anon auth to account: " + err
elif (credentialsXML.tag != adNS("success")): elif (credentialsXML.tag != adNS("success")):