From 8c4cebcd1a9c35b36d894e3b63519a521abe64b5 Mon Sep 17 00:00:00 2001 From: Luke Fritz Date: Thu, 18 Oct 2018 00:01:59 -0500 Subject: [PATCH] Remove extraneous params from subsequent query requests --- pyarlo/__init__.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pyarlo/__init__.py b/pyarlo/__init__.py index ade1347..edc71ca 100644 --- a/pyarlo/__init__.py +++ b/pyarlo/__init__.py @@ -64,7 +64,13 @@ def _authenticate(self): """Authenticate user and generate token.""" self.cleanup_headers() url = LOGIN_ENDPOINT - data = self.query(url, method='POST') + data = self.query( + url, + method='POST', + extra_params={ + 'email': self.__username, + 'password': self.__password + }) if isinstance(data, dict) and data.get('success'): data = data.get('data') @@ -82,9 +88,7 @@ def cleanup_headers(self): headers = {'Content-Type': 'application/json'} headers['Authorization'] = self.__token self.__headers = headers - - params = {'email': self.__username, 'password': self.__password} - self.__params = params + self.__params = {} def query(self, url,