diff --git a/backend/routes/member/create_member.go b/backend/routes/member/create_member.go index bea0f2e..d72d75f 100644 --- a/backend/routes/member/create_member.go +++ b/backend/routes/member/create_member.go @@ -75,7 +75,7 @@ func (s *Server) createMember(w http.ResponseWriter, r *http.Request) (err error if !db.MemberNameValid(cmr.Name) { return server.APIError{ Code: server.ErrBadRequest, - Details: "Member name cannot contain any of the following: @, \\, ?, !, #, /, \\, [, ], \", ', $, %, &, (, ), +, <, =, >, ^, |, ~, `, ,", + Details: "Member name cannot contain any of the following: @, ?, !, #, /, \\, [, ], \", ', $, %, &, (, ), +, <, =, >, ^, |, ~, `, ,", } } diff --git a/frontend/src/routes/@[username]/+page.svelte b/frontend/src/routes/@[username]/+page.svelte index 265465f..859c929 100644 --- a/frontend/src/routes/@[username]/+page.svelte +++ b/frontend/src/routes/@[username]/+page.svelte @@ -58,10 +58,13 @@ memberPage = memberPage + 1; }; + const memberNameRegex = /^[^@\\?!#\/\\\\[\]\"'$%&()+<=>^|~`,]{1,100}$/; let modalOpen = false; let toggleModal = () => (modalOpen = !modalOpen); let newMemberName = ""; let newMemberError: APIError | null = null; + let memberNameValid = true; + $: memberNameValid = memberNameRegex.test(newMemberName); const createMember = async () => { try { @@ -210,10 +213,8 @@
You don't have any members yet.
- Members are sub-profiles that can have their own avatar,
- names, pronouns, and preferred terms. (only you can see this)
+ Members are sub-profiles that can have their own avatar, names, pronouns, and preferred terms.
+ (only you can see this)
+