Changing uuid to uid (User ID)

This commit is contained in:
Fabian Stamm 2018-03-31 23:51:48 +00:00
parent cae29d263f
commit 5068fee5b8

View File

@ -14,7 +14,7 @@ class Auth(BaseAuth):
if user is None:
return False
main_uri = self.generate_base_uri(
"/client/check_pw") + "&uuid=" + user + "&password=" + password
"/client/check_pw") + "&uid=" + user + "&password=" + password
req = urllib.request.urlopen(main_uri, data=None)
jsons = req.read()
data = json.loads(jsons)
@ -24,15 +24,15 @@ class Auth(BaseAuth):
return True
def map_login_to_user(self, login):
# Get uuid from username
# Get uid from username
if login is None or login is "":
return None
main_uri = self.generate_base_uri(
"/client/uuid") + "&username=" + login
"/client/uid") + "&username=" + login
req = urllib.request.urlopen(main_uri, data=None)
jsons = req.read()
data = json.loads(jsons)
print(data)
if "error" in data:
return None
return data["uuid"]
return data["uid"]