Removing wrong closure
This commit is contained in:
parent
1b00616676
commit
3a19ba5fa7
@ -23,10 +23,10 @@ class Auth(BaseAuth):
|
|||||||
|
|
||||||
id = self.configuration.get("auth", "client_id")
|
id = self.configuration.get("auth", "client_id")
|
||||||
secret = self.configuration.get("auth", "client_secret")
|
secret = self.configuration.get("auth", "client_secret")
|
||||||
password = hashlib.sha512(salt + password.encode()).hexdigest())
|
password = hashlib.sha512(salt + password.encode()).hexdigest()
|
||||||
res2=requests.post("/api/internel/password", params = {
|
res2 = requests.post("/api/internel/password", params={
|
||||||
"client_id": id, "client_secret": secret}, json = {"uid": user, "password": password})
|
"client_id": id, "client_secret": secret}, json={"uid": user, "password": password})
|
||||||
data2=res2.json();
|
data2 = res2.json()
|
||||||
|
|
||||||
if "success" in data2 and data["success"] is True:
|
if "success" in data2 and data["success"] is True:
|
||||||
return True
|
return True
|
||||||
@ -36,9 +36,9 @@ class Auth(BaseAuth):
|
|||||||
# Get uid from username
|
# Get uid from username
|
||||||
if login is None or login is "":
|
if login is None or login is "":
|
||||||
return None
|
return None
|
||||||
req_data=dict()
|
req_data = dict()
|
||||||
res=requests.post(self.get_server + "/api/login?username=" + login)
|
res = requests.post(self.get_server + "/api/login?username=" + login)
|
||||||
data=res.json()
|
data = res.json()
|
||||||
if "error" in data:
|
if "error" in data:
|
||||||
return None
|
return None
|
||||||
return data["uid"]
|
return data["uid"]
|
||||||
|
Loading…
Reference in New Issue
Block a user