Prevent password reset email when email doesn't exist

I noticed that when a users email doesn’t exist in the database, the system will send an email with a password reset link. Is there a way to validate that the email exists and if so, send the email, else if the email does not exist to only display a message about a password reset request being sent, but not actual send the email?

Use conditional “Do a search for User: (email = input value) count is not 0”

1 Like

Hi @walterfiggeroa ,

Where did you see that ? Because Bubble automatically checks if the email address exists and returns an alert when it doesn’t. See screenshot of logs below.

Best,

Arthur

1 Like

That’s was my first thought too, but did not check

@arthur.kieffer when I test for the password reset link, I used my actual email, and it sent me a password reset link. I get it should have checked, and not sent the email.

I checked the logs, it says that it errored out due to the fact my email doesn’t exist, I never received there error, however I still did receive an email with a link to reset my so called password. When clicking that link, I get taken to the password reset, I can enter a new password, that’s when it errors out.

I want to make sure the email doesn’t get sent. I want to be able to have it when the user clicks the button check if the email exists, if it does send the email and a display a popup an email has been sent, and if it doesn’t exist, to just display the popup that an email has been sent.

@bartek.dev I will have to give that a try and see if I can get it to error out properly, and just display a message.

@bartek.dev and @arthur.kieffer, Thank you for the help, I figured it out, I was half asleep last night when I checking workflow error functions and custom error popups.

1 Like

Hi, Thought I’d recycle this thread rather than starting a new one. I have been playing with the password reset workflow and it doesn’t seem to be throwing an error when the email doesn’t exist. Am I looking in the wrong place?

Replying to update that I have solved my issue… it WAS failing, but I didn’t realise the logs were not showing me everything. I had to “show advanced” over to the right and check “Sending email failed” and voila, it shows me that the email failed to send.

So… how do I show an alert to the user then, that the email he typed in to do Reset Password does not exist (as a user). Currently Bubble just does nothing on the front end and user wouldn’t know that he may have tried to reset password with an email that doesn’t even have an user account at all… he may just assume there was some problem with sending or receiving the reset password email link…

I found a way around this. I will try to explain it as best as i can.

  1. when forgot password is clicked, a pop up should come up

  2. that pop up should have an input ( enter email associated with your account)

  3. the pop should have a button to send forgot pass email.

  4. User the "alert visual element to create an alert on the pop with a text “this email is not associated to an account”
    that is it for the design part. Now the workflow

  5. Create a workflow on the button (on step 3 above) to send a pw reset email. add a condition ( do a search for users each item users email contains the value of (step two input above) )

  6. Create a different workflow on the button (on step 3 above) to show the alert created in step 4 above. add a condition ( do a search for users each item users email doesn’t contain the value of (step two input above) )

I have attached pictures to make it simpler.
image


1 Like

Thanks so much! This solution worked perfectly for me.