Skip to content

Commit eb3fd86

Browse files
committed
fixed auth request utility
1 parent 95f586b commit eb3fd86

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

utils/auth_request.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@
2222
url = sys.argv[4]
2323

2424
# Authentication Request
25-
url = "https://ps." + url + "/api/org_token/"
25+
host = "https://ps." + url + "/api/org_token/"
2626
rqst = {"username": username, "password": password, "org_name": organization}
2727
headers = {'Content-Type': 'application/json'}
28-
rsps = requests.post(url, data=json.dumps(rqst), headers=headers, timeout=(60,10)).json()
28+
rsps = requests.post(host, data=json.dumps(rqst), headers=headers, timeout=(60,10)).json()
2929
print("Login Response: ", rsps)
3030
refresh = rsps["refresh"]
3131
access = rsps["access"]
3232

3333
# Organization Access Request
34-
url = "https://ps." + url + "/api/membership_status/" + organization + "/"
34+
host = "https://ps." + url + "/api/membership_status/" + organization + "/"
3535
headers = {'Authorization': 'Bearer ' + access}
36-
rsps = requests.get(url, headers=headers, timeout=(60,10)).json()
36+
rsps = requests.get(host, headers=headers, timeout=(60,10)).json()
3737
print("Validation Response: ", rsps)

0 commit comments

Comments
 (0)