diff --git a/auth.py b/auth.py index ca1d49b..e59abed 100644 --- a/auth.py +++ b/auth.py @@ -151,10 +151,9 @@ def authorize(data): # Get all required objects from API data_from_api = api_client().view( - "radius/authorize/{0}/{1}/{2}".format( + "radius/authorize/{0}/{1}".format( urllib.parse.quote(nas or "None", safe=""), urllib.parse.quote(username or "None", safe=""), - urllib.parse.quote(mac or "None", safe="") )) nas_type = data_from_api["nas"] @@ -188,25 +187,18 @@ def post_auth(data): # Get all required objects from API data_from_api = api_client().view( - "radius/post_auth/{0}/{1}/{2}".format( + "radius/post_auth/{0}/{1}/{2}/{3}".format( urllib.parse.quote(nas or "None", safe=""), urllib.parse.quote(nas_port or "None", safe=""), - urllib.parse.quote(mac or "None", safe="") - )) - - data_from_api2 = api_client().view( - "radius/authorize/{0}/{1}/{2}".format( - urllib.parse.quote(nas or "None", safe=""), - urllib.parse.quote(username or "None", safe=""), - urllib.parse.quote(mac or "None", safe="") + urllib.parse.quote(mac or "None", safe=""), + urllib.parse.quote(username or "None", safe="") )) nas_type = data_from_api["nas"] port = data_from_api["port"] switch = data_from_api["switch"] - nas_type = data_from_api2["nas"] - user = data_from_api2["user"] - user_interface = data_from_api2["user_interface"] + user = data_from_api["user"] + user_interface = data_from_api["user_interface"] # If proxified request if not nas_type: