[SOLVED] Prevent sign up from erasing custom user data

In my app a user logs in with facebook. After the Sign up/Login with facebook procedure, I’m making changes to the current user to pull data from facebook (profile pic, name, etc ) and then take them to a profile page. The log in button just logs the user in and takes them to the app’s profile page. One of the features on the profile page is that the user can change their profile pic so it’s more professional looking than what their facebook pic might be.

I’m running into an issue where if a user has logged in before and has an account I don’t want it to pull data from facebook in the event they accidentally click the sign up button instead of the log in button. This will allow me to keep the data that’s stored in the database, including their more professional profile picture. What I’m finding is that I seemingly don’t have a way of saying “if user exists, skip this step and just take them to the profile page” or “if user exists perform the log in procedure instead of the extra steps that happen at sign up”. What’s the normal work around for this in bubble?

Have you tried adding an “and when” clause to the sign-up button’s workflow that does a search for “User’s email does not equal current user’s email”? I’m not sure if this would work since they aren’t logged in yet, though.

But since technically the workflow action for login/sign-up through facebook is the same, I would expect it to do a check for the current user in the database anyways. I just tested using the facebook sign-up function on my website and from what I can tell the data in the User table wasn’t updated with any new information.

1 Like

By default I believe the facebook sign in leaves the data alone. I’m trying to work around if the user happens to click the sign up instead of log in since my sign up workflow has an extra action for initializing the user in the database.
Where or how can I set an action that escapes out of the sign up flow if the user data is not null?

Ah! I got it. I ended up using a custom event that gets triggered right after the facebook sign up event. The custom event runs and checks if the current user’s profile pic is empty and if it is then it will pull the data from FB and store it for that user in the db.

1 Like

Cool deal! Glad you got it figured out.