From d231be1aada77f0b658a596fc57e24efac62e7eb Mon Sep 17 00:00:00 2001 From: petergardfjall Date: Mon, 30 Mar 2015 19:40:14 +0200 Subject: [PATCH] fixed authentication issue --- garminexport/garminclient.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/garminexport/garminclient.py b/garminexport/garminclient.py index 413103c..d6e5fdc 100755 --- a/garminexport/garminclient.py +++ b/garminexport/garminclient.py @@ -142,10 +142,14 @@ class GarminClient(object): def _validate_auth_ticket(self, validation_url): log.debug("validating authentication ticket ...") response = self.session.get(validation_url, allow_redirects=True) - if not response.status_code == 200: - raise Exception( - u"failed to validate authentication ticket: {}:\n{}".format( - response.status_code, response.text)) + if response.status_code == 200 or response.status_code == 404: + # for some reason a 404 response code can also denote a + # successful auth ticket validation + return + + raise Exception( + u"failed to validate authentication ticket: {}:\n{}".format( + response.status_code, response.text)) @require_session