What I’m trying to do:
I have an app allowing users to create their account through a custom signup form.
I’m using a custom form because I want to collect more information (such as name, company, etc.) during the account creation process.
The user receives the email with the confirmation link, but clicking the link doesn’t change the user “confirmed_email” value to “True” in the user’s database, so they cannot log in to the app.
Selecting the option “Allow visitors to sign up” on the user’s options fixes the problem, but it also gives them the option to sign up through the normal signing page, which I don’t want to be available.
Is there any way to get the email confirmation working without activating the standard sign-up form?
Can you provide any other details, code snippets, or clone links to help us determine what actually might be the issue?
Also, perhaps consider taking a look at this example Custom Login and Sign Up
I think the code here is irrelevant. Revisiting that example (which I used to build my custom signup form), I realised that if allowing visitors to sign up is False, the mail verification system doesn’t work even though there are two different options.
Then, I will reformulate my question:
Can the verification mail service be made to work by using the standard sign-in form and a custom sign-up form?
Or, more specifically, why does the “Allow visitor to sign up” need to be activated for the “confirmed email” service to work? Is there any way to bypass it?
If the answer is no, then I’ll need to create a custom sign-in form, but it would be nice if this could be fixed in future updates.
If you want to allow new users to be created, this option always needs to be turned on.
However, you don’t need the default sign up form to allow your users to sign up. Instead, you can use
anvil.users.signup_with_email(email, password)
There are also functions available for signing up with Google, Facebook, or any other authentication system that is there in the signup form.
Also, when you invoke the signup_with_email
function, it will automatically send the confirmation email to user.
1 Like
Thank you @divyeshlakhotia.
I finally ended up creating a custom login form and everything works as expected.
1 Like