Added support to force auth refresh
This commit is contained in:
parent
8f1bd9473a
commit
6f0aa0360a
1 changed files with 2 additions and 2 deletions
|
@ -256,14 +256,14 @@ class PyiCloudService(object):
|
||||||
self._files = None
|
self._files = None
|
||||||
self._photos = None
|
self._photos = None
|
||||||
|
|
||||||
def authenticate(self):
|
def authenticate(self, force_refresh=False):
|
||||||
"""
|
"""
|
||||||
Handles authentication, and persists cookies so that
|
Handles authentication, and persists cookies so that
|
||||||
subsequent logins will not cause additional e-mails from Apple.
|
subsequent logins will not cause additional e-mails from Apple.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
login_successful = False
|
login_successful = False
|
||||||
if self.session_data.get("session_token"):
|
if self.session_data.get("session_token") and not force_refresh:
|
||||||
LOGGER.debug("Checking session token validity")
|
LOGGER.debug("Checking session token validity")
|
||||||
try:
|
try:
|
||||||
req = self.session.post(f"{self.SETUP_ENDPOINT}/validate", data="null")
|
req = self.session.post(f"{self.SETUP_ENDPOINT}/validate", data="null")
|
||||||
|
|
Loading…
Reference in a new issue