User Registration

What I’m trying to do:
We’re trying to improve our user registration flow and I’m having some trouble with the following:
We’d like to add a row in the user table before one of our users has registered (e.g by adding a new row and manually entering an email address) and enabling their account < before they have created their password. We’d then like them to be able to register and immediately login in.

  1. Manually add row for name@domain.com
  2. Enable that row
  3. Tell user that their account has been enabled and they can now register and login

What I’ve tried and what’s not working:

  1. Manually add a row for name@domain.com
  2. Enable that row
  3. When user registers, they get notification saying ‘This user already exists’
  4. User must create a new password to be able to login

Is there a good way to do what we are doing while using Anvil’s login function?

Steps 1 and 2 are correct. However, you need to customize the emails that you send to them (probably by adding a token that lets them set a password securely). So you have to make changes to the workflows in the Users service.

There is a lot of information on how to do this here:

It’s not as user-friendly, but you can set up the users and then instruct them to go through the “Forgot my Password” process the first time to log in. This avoids having to do any of the really secure stuff yourself.

1 Like