mirror of
https://github.com/gravitl/netmaker.git
synced 2025-09-04 04:04:17 +08:00
convert invited emails to lowercase (#3457)
This commit is contained in:
parent
614cf77b5a
commit
7840eedc7b
2 changed files with 5 additions and 1 deletions
|
@ -81,7 +81,8 @@ func sendTelemetry() error {
|
|||
Set("pro_trial_end_date", d.ProTrialEndDate.In(time.UTC).Format("2006-01-02")).
|
||||
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("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.IsSaasTenant = servercfg.DeployedByOperator()
|
||||
data.Domain = servercfg.GetNmBaseDomain()
|
||||
return data
|
||||
}
|
||||
|
||||
|
@ -202,6 +204,7 @@ type telemetryData struct {
|
|||
IsProTrial bool
|
||||
ProTrialEndDate time.Time
|
||||
IsSaasTenant bool
|
||||
Domain string
|
||||
}
|
||||
|
||||
// clientCount - What types of netclients we're tallying
|
||||
|
|
|
@ -210,6 +210,7 @@ func inviteUsers(w http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
}
|
||||
for _, inviteeEmail := range inviteReq.UserEmails {
|
||||
inviteeEmail = strings.ToLower(inviteeEmail)
|
||||
// check if user with email exists, then ignore
|
||||
if !email.IsValid(inviteeEmail) {
|
||||
logic.ReturnErrorResponse(w, r, logic.FormatError(errors.New("invalid email "+inviteeEmail), "badrequest"))
|
||||
|
|
Loading…
Add table
Reference in a new issue