1

I have a form to sign up for a trial (offline product) and I feel like the most logical place to store that data is Users, but requiring a password on sign up will likely put people off.

How could I get a frontend form to create a user without requiring a password? One thought it a hidden field and then programmatically changing the password to something random immediately after the save-user action, but I'm not sure how to do that.

Very open to other ideas too.

4

What you want is the deferPublicRegistrationPassword config setting.

By default, Craft will require a 'password' field to be submitted on front-end, public user registrations. Setting this to true will no longer require it on the initial registration form.

If you have email verification enabled, new users will set their password once they've clicked on the verification link in the email. If you don't, the only way they can set their password is to go through your "forgot password" workflow.

| improve this answer | |
  • Ah perfect! I thought this was a thing but couldn't find it anywhere. Thanks heaps! – tommysvr Aug 8 at 4:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.