chore: add user id when logging for analytics

This commit is contained in:
pablohashescobar 2023-03-29 16:15:11 +05:30
parent 2786f09e85
commit 3ba9cddc2a
2 changed files with 6 additions and 6 deletions

View File

@ -99,7 +99,7 @@ class SignInEndpoint(BaseAPIView):
"event_data": { "event_data": {
"medium": "email", "medium": "email",
}, },
"user": {"email": email}, "user": {"email": email, "id": user.id},
"device_ctx": { "device_ctx": {
"ip": request.META.get("REMOTE_ADDR"), "ip": request.META.get("REMOTE_ADDR"),
"user_agent": request.META.get("HTTP_USER_AGENT"), "user_agent": request.META.get("HTTP_USER_AGENT"),
@ -150,7 +150,7 @@ class SignInEndpoint(BaseAPIView):
"event_data": { "event_data": {
"medium": "email", "medium": "email",
}, },
"user": {"email": email}, "user": {"email": email, "id": user.id},
"device_ctx": { "device_ctx": {
"ip": request.META.get("REMOTE_ADDR"), "ip": request.META.get("REMOTE_ADDR"),
"user_agent": request.META.get("HTTP_USER_AGENT"), "user_agent": request.META.get("HTTP_USER_AGENT"),
@ -324,7 +324,7 @@ class MagicSignInEndpoint(BaseAPIView):
"event_data": { "event_data": {
"medium": "code", "medium": "code",
}, },
"user": {"email": email}, "user": {"email": email, "id": user.id},
"device_ctx": { "device_ctx": {
"ip": request.META.get("REMOTE_ADDR"), "ip": request.META.get("REMOTE_ADDR"),
"user_agent": request.META.get( "user_agent": request.META.get(
@ -354,7 +354,7 @@ class MagicSignInEndpoint(BaseAPIView):
"event_data": { "event_data": {
"medium": "code", "medium": "code",
}, },
"user": {"email": email}, "user": {"email": email, "id": user.id},
"device_ctx": { "device_ctx": {
"ip": request.META.get("REMOTE_ADDR"), "ip": request.META.get("REMOTE_ADDR"),
"user_agent": request.META.get( "user_agent": request.META.get(

View File

@ -217,7 +217,7 @@ class OauthEndpoint(BaseAPIView):
"event_data": { "event_data": {
"medium": f"oauth-{medium}", "medium": f"oauth-{medium}",
}, },
"user": {"email": email}, "user": {"email": email, "id": user.id},
"device_ctx": { "device_ctx": {
"ip": request.META.get("REMOTE_ADDR"), "ip": request.META.get("REMOTE_ADDR"),
"user_agent": request.META.get("HTTP_USER_AGENT"), "user_agent": request.META.get("HTTP_USER_AGENT"),
@ -285,7 +285,7 @@ class OauthEndpoint(BaseAPIView):
"event_data": { "event_data": {
"medium": f"oauth-{medium}", "medium": f"oauth-{medium}",
}, },
"user": {"email": email}, "user": {"email": email, "id": user.id},
"device_ctx": { "device_ctx": {
"ip": request.META.get("REMOTE_ADDR"), "ip": request.META.get("REMOTE_ADDR"),
"user_agent": request.META.get("HTTP_USER_AGENT"), "user_agent": request.META.get("HTTP_USER_AGENT"),