diff --git a/satellite/console/consoleweb/consoleapi/projects.go b/satellite/console/consoleweb/consoleapi/projects.go index 1543b53a2..7d78ea8d8 100644 --- a/satellite/console/consoleweb/consoleapi/projects.go +++ b/satellite/console/consoleweb/consoleapi/projects.go @@ -7,6 +7,7 @@ import ( "encoding/base64" "encoding/json" "net/http" + "strings" "time" "github.com/gorilla/mux" @@ -91,6 +92,10 @@ func (p *Projects) InviteUsers(w http.ResponseWriter, r *http.Request) { return } + for i, email := range data.Emails { + data.Emails[i] = strings.TrimSpace(email) + } + _, err = p.service.InviteProjectMembers(ctx, id, data.Emails) if err != nil { p.serveJSONError(w, http.StatusInternalServerError, err) diff --git a/web/satellite/src/components/modals/AddTeamMemberModal.vue b/web/satellite/src/components/modals/AddTeamMemberModal.vue index ed0be7977..e8fd0fbf5 100644 --- a/web/satellite/src/components/modals/AddTeamMemberModal.vue +++ b/web/satellite/src/components/modals/AddTeamMemberModal.vue @@ -146,6 +146,8 @@ async function onAddUsersClick(): Promise { let areAllEmailsValid = true; const emailArray: string[] = []; + inputs.value.forEach(elem => elem.value = elem.value.trim()); + for (let i = 0; i < length; i++) { const element = inputs.value[i]; const isEmail = Validator.email(element.value);