I’ve just set up Google authflow for users to create accounts/sign in.
However, I’m not sure how to delineate the experience with workflows based on if a user is creating an account for the first time, vs signing in to their existing account.
When a user signs up for the first time with email, I have specific settings being updated in the database. And I’d like to replicate this with social media creations.
And when they log back in with email, it uses a different workflow, so those processes don’t get triggered a second time.
But, since bubble consolidates the workflow into sign-up/sign-in, I can’t figure out how to prevent those unintended changes for users who are just signing-in with social accounts.
Scratch that. Figured it out. Commenting incase it helps someone else.
Just added a ‘User-Initialized’ data field with yes/no value. Set no as the default value. Then had a workflow fire after log-in/sign up. Setting up the initial values only when initialed=no. And then setting initialed=yes after.
What you want to do is check whether the user is new right after the social login happens. Bubble actually has a built-in condition for this in the “Sign the user up/log them in with a social network” workflow step: there’s an option called “Only when current user is new”.
You can use that to run the same database updates or initial setup you do for email sign-ups, and then have a separate workflow (or no extra actions) for returning users. Essentially, anything you only want for first-time accounts goes inside that condition.
That way, social logins for existing users won’t trigger the first-time setup again.
Great solution using the User-Initialized flag. That’s a clean approach.
Just to add - there’s also a built-in Bubble feature for this. When you use “Sign the user up/log them in with a social network” action, you can add steps with the condition “Only when” and select “current user is new”.
This way you don’t need an extra database field. Bubble tracks whether the social login is a new signup or returning user automatically.
Both approaches work. Your flag method gives you more control if you need to track initialization status for other purposes. The built-in condition is simpler for straightforward cases.