diff --git a/Web/push_notifications.py b/Web/push_notifications.py index 5c50f9c..6e3fa1e 100644 --- a/Web/push_notifications.py +++ b/Web/push_notifications.py @@ -142,7 +142,7 @@ def save_push_subscription(username, subscription_obj): # Create unique hash of subscription using plaintext data to avoid duplicates sub_hash = hashlib.shake_256( f"{username}:{endpoint}".encode('utf-8') - ).hexdigest() + ).hexdigest(32) # Check if subscription already exists by Hash existing = subs_col.find_one({ @@ -197,7 +197,7 @@ def remove_push_subscription(username, endpoint): sub_hash = hashlib.shake_256( f"{username}:{endpoint}".encode('utf-8') - ).hexdigest() + ).hexdigest(32) result = subs_col.update_one( {'SubscriptionHash': sub_hash},