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

@@ -3,6 +3,7 @@ package command
import (
"context"
"fmt"
"strings"
"time"
"github.com/zitadel/logging"
@@ -19,6 +20,7 @@ import (
)
func (c *Commands) ChangeUsername(ctx context.Context, orgID, userID, userName string) (*domain.ObjectDetails, error) {
userName = strings.TrimSpace(userName)
if orgID == "" || userID == "" || userName == "" {
return nil, caos_errs.ThrowInvalidArgument(nil, "COMMAND-2N9fs", "Errors.IDMissing")
}