[web][kverify] use new api vesion

- data["mnt] is now a list of strings instead of string
This commit is contained in:
lare 2023-06-09 15:37:29 +02:00
parent 23fa5ba1a6
commit 67f10102b3

View file

@ -43,12 +43,16 @@ class AuthVerifyer ():
user_data = json.loads(base64.b64decode(params)) user_data = json.loads(base64.b64decode(params))
if (time.time() - user_data["time"]) > 60: if (time.time() - user_data["time"]) > 60:
return False, "Signature to old" return False, "Signature to old"
elif user_data["domain"] != self.domain.replace("https://",""):
return False, "invalid domain"
except json.decoder.JSONDecodeError: except json.decoder.JSONDecodeError:
# we shouldn't get here unless kioubit's service is misbehaving # we shouldn't get here unless kioubit's service is misbehaving
return False, "invalid JSON" return False, "invalid JSON"
except KeyError: except KeyError:
return False, "value not found in JSON" return False, "value not found in JSON"
logging.debug(user_data) logging.debug(user_data)
# use mnt[0] as mnt
user_data["mnt"] = user_data["mnt"][0]
return True, user_data return True, user_data