Fixed auth issue for non-2FA iCloud accounts (#48455)

This commit is contained in:
Niccolo Zapponi 2021-03-30 06:09:27 +01:00 committed by GitHub
parent 2fbe352ad5
commit fc8dc038e2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -115,8 +115,7 @@ class IcloudAccount:
with_family=self._with_family,
)
if not self.api.is_trusted_session or self.api.requires_2fa:
# Session is no longer trusted
if self.api.requires_2fa:
# Trigger a new log in to ensure the user enters the 2FA code again.
raise PyiCloudFailedLoginException
@ -163,7 +162,7 @@ class IcloudAccount:
if self.api is None:
return
if not self.api.is_trusted_session or self.api.requires_2fa:
if self.api.requires_2fa:
self._require_reauth()
return