Forum Academy Marketplace Showcase Pricing Features

Only sign up user if it doesn't exist

Hello, trying to integrate registration and for some reason the logic is failing, I’m pretty sure it’s something dumb from my side that I’m not seeing , maybe someone would know

I want to register the user by ‘email’ only if the number of accounts with such email equals to 0 -

And my email does exist in the database

But when trying to register it says there are 0 accounts with such emails.

What am I missing here? :roll_eyes:
Thank you

Try search for users:count <1

However, bubble gives the user an automatic JavaScript feedback if the user already exists (See screenshot below).

1 Like

Thank you, tried with < 1 and it’s still true, meaning bubble thinks that there are no such users, my guess is maybe the email format is messing with the search?
maybe it’s because of the dot… I don’t know

I have created this simple text to display how many users in total there are, and it says - 1
Even though there are 3 users in total :roll_eyes:

Are you testing and double-checking the database in the same version?
The users in your test version are not stored in your live version.

1 Like

Definitely not, haven’t ordered the paid plan yet, so I can’t even deploy to live :cowboy_hat_face:
Here I have created a repeating group to get all the users, and for some magical reason only 1 of the users appear -

Edit-, okay we are moving somewhere, when I ‘log in’ as a particular user, his details are displayed in the repeating group, but should ALL the users be displayed there? I really don’t understand something.

Here’s a video of what’s happening -

It looks like your privacy rules are blocking you (as they should, really, since users shouldn’t be able to access each other’s data). You can make the user object open by removing any restrictive rules from the Data tab → Privacy subtab.

Just a note, though, you should never leave your privacy rules open like that, but it might be instructive to mess around with them a bit.

1 Like

Thank you ! That does make a lot of sense. Maybe you have a tip how to check if there is an user with X email when registering?

This is needed because I am working with facebook’s login, so every time user connects his facebook we want to check if user with such email exists, and if not then register him

Take note that Bubble will not allow two users to signup with the same email. Bubble will return an error if the email already exist in DB

1 Like

Thanks for the reply.
Still haven’t found a way how to solve this issue, I am using ‘pathfix sso connector’ plugin to authenticate users through facebook.
Basically on every page load the plugin checks if user is connected through facebook, and if he is - then create an account with all the details ONLY if user with such email doesn’t exist.

But we can’t access users emails, so really not sure what to do, only thing I can think of is creating a separate db with users emails only, and checking that, but that is also a safety concern…

This topic was automatically closed after 70 days. New replies are no longer allowed.