mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-04 16:33:49 +08:00
convert invited emails to lowercase (#3457)
This commit is contained in:
@@ -81,7 +81,8 @@ func sendTelemetry() error {
|
|||||||
Set("pro_trial_end_date", d.ProTrialEndDate.In(time.UTC).Format("2006-01-02")).
|
Set("pro_trial_end_date", d.ProTrialEndDate.In(time.UTC).Format("2006-01-02")).
|
||||||
Set("admin_email", adminEmail).
|
Set("admin_email", adminEmail).
|
||||||
Set("email", adminEmail). // needed for posthog intgration with hubspot. "admin_email" can only be removed if not used in posthog
|
Set("email", adminEmail). // needed for posthog intgration with hubspot. "admin_email" can only be removed if not used in posthog
|
||||||
Set("is_saas_tenant", d.IsSaasTenant),
|
Set("is_saas_tenant", d.IsSaasTenant).
|
||||||
|
Set("domain", d.Domain),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -105,6 +106,7 @@ func FetchTelemetryData() telemetryData {
|
|||||||
data.IsProTrial = true
|
data.IsProTrial = true
|
||||||
}
|
}
|
||||||
data.IsSaasTenant = servercfg.DeployedByOperator()
|
data.IsSaasTenant = servercfg.DeployedByOperator()
|
||||||
|
data.Domain = servercfg.GetNmBaseDomain()
|
||||||
return data
|
return data
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -202,6 +204,7 @@ type telemetryData struct {
|
|||||||
IsProTrial bool
|
IsProTrial bool
|
||||||
ProTrialEndDate time.Time
|
ProTrialEndDate time.Time
|
||||||
IsSaasTenant bool
|
IsSaasTenant bool
|
||||||
|
Domain string
|
||||||
}
|
}
|
||||||
|
|
||||||
// clientCount - What types of netclients we're tallying
|
// clientCount - What types of netclients we're tallying
|
||||||
|
@@ -210,6 +210,7 @@ func inviteUsers(w http.ResponseWriter, r *http.Request) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
for _, inviteeEmail := range inviteReq.UserEmails {
|
for _, inviteeEmail := range inviteReq.UserEmails {
|
||||||
|
inviteeEmail = strings.ToLower(inviteeEmail)
|
||||||
// check if user with email exists, then ignore
|
// check if user with email exists, then ignore
|
||||||
if !email.IsValid(inviteeEmail) {
|
if !email.IsValid(inviteeEmail) {
|
||||||
logic.ReturnErrorResponse(w, r, logic.FormatError(errors.New("invalid email "+inviteeEmail), "badrequest"))
|
logic.ReturnErrorResponse(w, r, logic.FormatError(errors.New("invalid email "+inviteeEmail), "badrequest"))
|
||||||
|
Reference in New Issue
Block a user