I want to verify users’ email addresses using Bubble’s built-in functions.
I can detect whether a user has verified, and thus stop them using the app, but I also believe I cannot send an confirmation email unless the user is logged in?
So let’s say a user signs up and the email confirmation link is sent but goes to spam, or they ignore it and so they don’t confirm it to be a valid email address.
When they return to the app and try to load a functional page (as opposed to the index menu page) I want to prevent them from using the app because they have not confirmed. But I would like to offer the opportunity to receive a new confirmation email. However, it seems can only send that new confirmation if they are logged. Catch-22.
Is my understanding correct and if yes, what’s the best workaround?
Just send them another email confirmation link. If they’re not still logged in (check the current user’s is logged in status - I think the default session duration is three days), then just prompt them for their password and log them in before sending.
As an aside, note that sending an email confirmation link automatically resets the user’s email confirmed property (i.e. sets it to “no”). This can be leveraged if for any reason you wish to explicitly reconfirm a user’s email.