Skip to content

Commit e489b4a

Browse files
committed
fix: Match original unify_identify_js implementation
1 parent 1667454 commit e489b4a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

reflex_ui/blocks/telemetry/unify.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
"""Unify analytics tracking integration for Reflex applications."""
22

3-
import json
4-
53
import reflex as rx
64

75
PIXEL_SCRIPT_UNIFY: str = """
@@ -29,8 +27,10 @@ def unify_identify_js(
2927
Returns:
3028
str: JavaScript code to identify the user in Unify
3129
"""
30+
import json
31+
3232
# Escape the email to prevent XSS
33-
escaped_email = email.replace("\\", "\\\\").replace("'", "\\'").replace('"', '\\"')
33+
escaped_email = email.replace("'", "\\'").replace('"', '\\"').replace("\\", "\\\\")
3434

3535
# Build the person object - email is always required
3636
person_obj: dict[str, str | int | bool] = {"email": email}

0 commit comments

Comments
 (0)