From 45f961a9fe65127980e0e12a46ac4ac8f5b5752b Mon Sep 17 00:00:00 2001 From: decentral1se <1991377+decentral1se@users.noreply.github.com> Date: Thu, 25 May 2023 11:15:10 +0200 Subject: [bugfix] allow usernames of length 1 (#1823) Closes https://github.com/superseriousbusiness/gotosocial/issues/1691. Co-authored-by: decentral1se --- internal/validate/formvalidation_test.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'internal/validate/formvalidation_test.go') diff --git a/internal/validate/formvalidation_test.go b/internal/validate/formvalidation_test.go index 9cfa07700..4dff5b60d 100644 --- a/internal/validate/formvalidation_test.go +++ b/internal/validate/formvalidation_test.go @@ -93,6 +93,7 @@ func (suite *ValidationTestSuite) TestValidateUsername() { trailingSpace := "thisusername_ends_with_a_space " newlines := "this_is\n_almost_ok" goodUsername := "this_is_a_good_username" + singleChar := "s" var err error err = validate.Username(empty) @@ -118,6 +119,9 @@ func (suite *ValidationTestSuite) TestValidateUsername() { err = validate.Username(goodUsername) suite.NoError(err) + + err = validate.Username(singleChar) + suite.NoError(err) } func (suite *ValidationTestSuite) TestValidateEmail() { -- cgit v1.2.3