Skip to content
This repository has been archived by the owner on Jul 30, 2021. It is now read-only.

Commit

Permalink
Remove extraneous params from subsequent query requests
Browse files Browse the repository at this point in the history
  • Loading branch information
lukiffer committed Oct 18, 2018
1 parent c9b5a2d commit 8c4cebc
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions pyarlo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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,
Expand Down

0 comments on commit 8c4cebc

Please sign in to comment.