Skip to content

Commit

Permalink
Bug fixes done and tested with new API controllers in App.
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnSundarraj committed Nov 8, 2022
1 parent 0a4a4a1 commit 23a5d59
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions source/sloopengine/resource/credential.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ def __init__(self):
'url':main_conf['account']['url']
}
self.user = {
'api_key':{
'id':credential_conf['user']['api_key']['id'],
'token':credential_conf['user']['api_key']['token']
}
'token':credential_conf['user']['token']
}

# Create Credential.
Expand Down Expand Up @@ -111,14 +108,13 @@ def get(self,data):
)
headers = {
'Authorization':''.join(
'SloopEngine %s:%s'
%(self.user['api_key']['id'],self.user['api_key']['token'])
'%s' %(self.user['token'])
)
}
request = requests.get(url,headers=headers)
response = request.json()
if request.status_code==200 and response['status']=='success':
credential_data = response['result']['credential']
credential_data = response['result']
else:
return
except Exception as error:
Expand Down

0 comments on commit 23a5d59

Please sign in to comment.