feat: Update message to include session uuid
All checks were successful
Build Docker / Build Docker (push) Successful in 37s
All checks were successful
Build Docker / Build Docker (push) Successful in 37s
This commit is contained in:
@@ -201,6 +201,15 @@ def hnsid():
|
||||
address = request.json.get("address")
|
||||
signature = request.json.get("signature")
|
||||
message = request.json.get("message")
|
||||
|
||||
# Make sure message is in the correct format
|
||||
if not message.startswith("I am signing this message to log in to HNS Login as "):
|
||||
print("Invalid message format")
|
||||
return jsonify({"success": False})
|
||||
if not message.endswith(session["uuid"]):
|
||||
print("Invalid message format")
|
||||
return jsonify({"success": False})
|
||||
|
||||
# Verify the signature
|
||||
msg = encode_defunct(text=message)
|
||||
signer = Account.recover_message(msg, signature=signature).lower()
|
||||
|
||||
Reference in New Issue
Block a user