How to confirm user email address on sign-up

A common best-practice in web apps is to confirm user email address when they sign up.

This is beneficial because it helps prevent spam, enhances security and improves the integrity of your data.

Here’s how to setup your Knack app to confirm email address on sign-up, all using Knack-native features (no custom-code required)

4 Likes

Great video @Callum.Boase - some really good tips and tricks clearly explained. A great feature all achieved with native Knackness :+1:

I’ve used the zero record table solution many times, I also hide the table with the below code. As you know I’m not a coder, I picked this snippet up years ago. It hides any tables on a scene where there are zero records. That way, even if the user walks back through the URL and finds the table with zero records it will just show a blank page.

I have to admit, I didn’t know you could remove the parent part of the URL and link directly to the child page (with the relevant RECORD ID) thereby removing the breadcrumb navigation.

Everyday is a school day. :man_teacher:

I’ve always coded them out with CSS :man_technologist: :face_with_peeking_eye:

That’s one of the many things I love about Knack and our community, even after years of building I’m always learning something new.

Thank you so much for taking the time to produce the video content and freely share your amazing knowledge. :pray:


/* Change the scene_1 to the scene key of your choice, or replace with any to work on all pages. */
$(document).on('knack-scene-render.scene_1', function(event, scene) {
  // Loop through each scene view, on the page.
  scene.views.map(function(view) {
    // If view has row data and that data is less than 1...
    if(Knack.models[view.key] && Knack.models[view.key].data && Knack.models[view.key].data.length < 1) {
      // Remove the specific view.
    	$('#' + view.key).remove();
    }
  });
});

1 Like

Nice one, @Callum.Boase!

1 Like

This is pretty cool. I am having an issue. When I try to confirm the email. the form does not submit. It appears to be changing the last character of the record ID so that it is not associated with the proper record. Any thoughts would be helpful.

Thanks Carl!
Yes I often hide the table with something like that CSS too.
For those reading back here later, it’s important to note that hiding the parent page with CSS does NOT stop users accessing the data shown, it simply hides the data.
But adding setting the parent page grid view to use 0 records is actually securing your data properly because users cannot access it even if they used the API or circumvented your CSS.
So the 0-record filter on the parent page grid view is essential for security, but the CSS to hide the contents of the parent page is just a nice touch

Hi Peter,
Sorry to hear you’re having trouble.
Can you send through some screenshots and/or a short video showing your current configuration & the issue you’re seeing? Happy to try and help