From fbb4acbc88d09a7e15899ac42f8873a1ea69ca96 Mon Sep 17 00:00:00 2001 From: derrod Date: Tue, 28 Dec 2021 10:15:23 +0100 Subject: [PATCH] [core] Add option to force refresh token instead of session resumption --- legendary/core.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/legendary/core.py b/legendary/core.py index 46ae3f1..48acc22 100644 --- a/legendary/core.py +++ b/legendary/core.py @@ -174,7 +174,7 @@ class LegendaryCore: self.log.error(f'Logging in failed with {e!r}, please try again.') return False - def login(self) -> bool: + def login(self, force_refresh=False) -> bool: """ Attempts logging in with existing credentials. @@ -202,7 +202,7 @@ class LegendaryCore: else: self.apply_lgd_config() - if self.lgd.userdata['expires_at']: + if self.lgd.userdata['expires_at'] and not force_refresh: dt_exp = datetime.fromisoformat(self.lgd.userdata['expires_at'][:-1]) dt_now = datetime.utcnow() td = dt_now - dt_exp