Skip to content

Commit

Permalink
Allow calls for trusted devices to fail silently #819 (#825)
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreyNikiforov authored Apr 27, 2024
1 parent c54157e commit 0276b17
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Unreleased

- experimental: fix errors in npm packages
- fix: allow calls for trusted devices to fail silently [#819](https://github.com/icloud-photos-downloader/icloud_photos_downloader/issues/819)

## 1.17.4 (2024-04-10)

Expand Down
5 changes: 4 additions & 1 deletion src/icloudpd/authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,10 @@ def request_2sa(icloud: pyicloud_ipd.PyiCloudService, logger: logging.Logger):

def request_2fa(icloud: pyicloud_ipd.PyiCloudService, logger: logging.Logger):
"""Request two-factor authentication."""
devices = icloud.trusted_devices
try:
devices = icloud.trusted_devices
except:
devices = []
if len(devices) > 0:
if len(devices) > 99:
logger.error("Too many trusted devices for authentication")
Expand Down

0 comments on commit 0276b17

Please sign in to comment.