2

I'm trying to get some feedback for the user on registration when the username already exists but I don't know in which object the errors are.

I use the form they provide in the docs: https://docs.craftcms.com/v3/dev/examples/user-registration-form.html

Same for the forgot password form if the user doesn't exists in the system, I'm not able the provide the right feedback with this form: https://docs.craftcms.com/v3/dev/examples/forgot-password-form.html

1

I just tested this with the user registration for in your link and got the expected behavior when you try to register with a username that already exists.

enter image description here

A few things to check.

  1. Make sure you have public registration enabled in the Control Panel under Settings->Users->Settings.

  2. When you're testing registering a user in your front-end form, make sure you're logged out of your current user account.

| improve this answer | |
  • The problem is that it doesn't work on a module route, it seems to work fine on my homepage. I'm able to access the error with: {% if craft.app.session.has('error') %} <ul class="form__errors-list spacer spacer--xsm"> <li>{{ craft.app.session.get('error') }}</li> </ul> {% endif %} But then I don't have the loginName, rememberMe and errorCode. Any idea what I need to do to just use the docs example and make the magic work? – wietse Sep 18 '18 at 14:34

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.