diff --git a/server/api/auth.go b/server/api/auth.go index 7d446f748..dfab32985 100644 --- a/server/api/auth.go +++ b/server/api/auth.go @@ -297,6 +297,8 @@ func (a *API) handleRegister(w http.ResponseWriter, r *http.Request) { a.errorResponse(w, r.URL.Path, http.StatusInternalServerError, "", err) return } + registerData.Email = strings.TrimSpace(registerData.Email) + registerData.Username = strings.TrimSpace(registerData.Username) // Validate token if len(registerData.Token) > 0 { diff --git a/webapp/src/pages/registerPage.tsx b/webapp/src/pages/registerPage.tsx index a78a91a4c..48b437033 100644 --- a/webapp/src/pages/registerPage.tsx +++ b/webapp/src/pages/registerPage.tsx @@ -56,7 +56,7 @@ const RegisterPage = React.memo(() => { id='login-email' placeholder={'Enter email'} value={email} - onChange={(e) => setEmail(e.target.value)} + onChange={(e) => setEmail(e.target.value.trim())} />
@@ -64,7 +64,7 @@ const RegisterPage = React.memo(() => { id='login-username' placeholder={'Enter username'} value={username} - onChange={(e) => setUsername(e.target.value)} + onChange={(e) => setUsername(e.target.value.trim())} />