Skip to content

Commit

Permalink
[pocketbase#3697] allowed hyphens in usernames
Browse files Browse the repository at this point in the history
  • Loading branch information
ganigeorgiev committed Nov 11, 2023
1 parent 5835193 commit 890a090
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion forms/record_upsert.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
)

// username value regex pattern
var usernameRegex = regexp.MustCompile(`^[\w][\w\.]*$`)
var usernameRegex = regexp.MustCompile(`^[\w][\w\.\-]*$`)

// RecordUpsert is a [models.Record] upsert (create/update) form.
type RecordUpsert struct {
Expand Down
2 changes: 1 addition & 1 deletion forms/record_upsert_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,7 @@ func TestRecordUpsertAuthRecord(t *testing.T) {
"create with all allowed auth fields",
"",
map[string]any{
"username": "test_new",
"username": "test_new-a.b",
"email": "[email protected]",
"emailVisibility": true,
"password": "12345678",
Expand Down

0 comments on commit 890a090

Please sign in to comment.