User registration username and password validation

New Member
5 0 0

Hi all.

I have recently been in contact with Shopify support about what I believed to be two bugs:

1) if a user registers for an account (at /account/register), if they include *any* mistake in the form (i.e. password too short), upon submission all data is erased, and the user needs to start afresh. Note, this is true of all shops that I have tested. (Incidentally, it means that often the errors displayed after submission dont make a lot of sense - try submitting an email, but no password, using the Debut theme for example, and you get presented with an emptied form with a "password cannot be blank" error ... but now the email address is also blank ... but no error is listed for that one).

2) its possible to create an alternate registration template (which is then viewable by visiting /account/register?view=whatever). This is handy, as it means we can have per-promo sign-up pages (possibly even including additional customer "note" fields to capture additional information). The problem is, though, that if the form is submitted, again with any error, rather than reloading the custom template, the user is *always* taken to the default template - /account/register . This means that any additional fields might disappear (as in the fields might themselves disappear, not just the data that should be in them, see "1", above ... which will - I imagine - leave customers rather confused).

Shopify support has indicated that "1" is by design (for security reasons). I did not get a response re. "2". This leaves me in a bind:  it seems that the best way to avoid emptying the forms, and avoiding redirecting to a completely different form, is to do in-form validation using JS. To do that though, I need to know what the fields/validation requirements are. I cannot find this documented anywhere. So my question:

- What are the requirements for usernames? Can they contain spaces? Max length? Min length? What about extended character sets? Is there a regex somewhere that captures the field requirements?

- What about passwords ... ?

I hope that by capturing form errors before submission, I can reduce churn on our sites.

Thoughts very much appreciated. Thanks in advance!