Skip to content

Commit

Permalink
Merge pull request #112 from jefft0/chore/sign-up-name-check-regex
Browse files Browse the repository at this point in the history
chore: In the sign-up name check, use the same regex and error message as r/demo/users
  • Loading branch information
jefft0 authored Jul 2, 2024
2 parents 1bebd4d + 4a8159e commit 6871a0c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mobile/app/sign-up.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ export default function Page() {
return;
}

if (name.length < 6) {
setError("Account name must be at least 6 characters");
// Use the same regex and error message as r/demo/users
if (!name.match(/^[a-z]+[_a-z0-9]{5,16}$/)) {
setError("Account name must be at least 6 characters, lowercase alphanumeric with underscore");
return;
}

Expand Down

0 comments on commit 6871a0c

Please sign in to comment.