fix: trim spaces for usernames and organization names (#4217)

This commit is contained in:
Livio Spring
2022-08-19 15:00:14 +02:00
committed by GitHub
parent d656b3f3c9
commit cc612fed07
8 changed files with 334 additions and 7 deletions

View File

@@ -1,6 +1,8 @@
package domain
import (
"strings"
"github.com/zitadel/zitadel/internal/eventstore/v1/models"
)
@@ -15,7 +17,11 @@ type Org struct {
}
func (o *Org) IsValid() bool {
return o != nil && o.Name != ""
if o == nil {
return false
}
o.Name = strings.TrimSpace(o.Name)
return o.Name != ""
}
func (o *Org) AddIAMDomain(iamDomain string) {