mirror of
https://github.com/PostHog/posthog.git
synced 2024-11-24 00:47:50 +01:00
chore: use the wrapper token if it exists (#25381)
This commit is contained in:
parent
eba5bb5515
commit
5d036bb48c
@ -14,6 +14,7 @@ type PostHogEventWrapper struct {
|
|||||||
DistinctId string `json:"distinct_id"`
|
DistinctId string `json:"distinct_id"`
|
||||||
Ip string `json:"ip"`
|
Ip string `json:"ip"`
|
||||||
Data string `json:"data"`
|
Data string `json:"data"`
|
||||||
|
Token string `json:"token"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type PostHogEvent struct {
|
type PostHogEvent struct {
|
||||||
@ -109,7 +110,9 @@ func (c *PostHogKafkaConsumer) Consume() {
|
|||||||
phEvent.Uuid = wrapperMessage.Uuid
|
phEvent.Uuid = wrapperMessage.Uuid
|
||||||
phEvent.DistinctId = wrapperMessage.DistinctId
|
phEvent.DistinctId = wrapperMessage.DistinctId
|
||||||
|
|
||||||
if phEvent.Token == "" {
|
if wrapperMessage.Token != "" {
|
||||||
|
phEvent.Token = wrapperMessage.Token
|
||||||
|
} else if phEvent.Token == "" {
|
||||||
if tokenValue, ok := phEvent.Properties["token"].(string); ok {
|
if tokenValue, ok := phEvent.Properties["token"].(string); ok {
|
||||||
phEvent.Token = tokenValue
|
phEvent.Token = tokenValue
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user