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

pull/48009/head
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
1 changed files with 2 additions and 3 deletions

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