How do I set up oauth for both gmail and facebook in the same sign-up element?

(Very) new to Bubble and getting my head around the system. As such, would really appreciate help on an issue I’m having right now:

within the same sign up form, I want the user to have the ability to register via any of the below:

  1. Google
  2. Fb
  3. Email

How can I set that up accordingly in the workflow? I’ve already set up OAuth for fb (App id/secret), but I want to have Google and Email within the same sign-up form.

Right now I seem to only have the option of setting up OAuth with EITHER Google or Fb- what am I missing?

Right now, this action is triggered when someone clicks “Setup my Account”

If you want that same button to trigger 1 of the 3 actions depending on which one the user has selected, then you’d want to do something like this:

  • Set a custom-state on the page for the selected sign-up option. And, set the value of this custom state based on which option the user selects.
  • Then add 2 actions (just to the right of the Signup/login with Google Calendar) - one for FB and one for Email.
  • Then set those actions to run “Only when” the user selected that type of sign-up option (e.g., the custom-state’s value from step 1 is “Facebook”).

I hope this points you in the right direction.

Thanks Sridharan.

When you say create a custom-state on the page for the selected sign-up option, do you mean to say that I should create a separate page for each button?

I was under the impression that since the API was set up for both plugins I could just work internally and set up each element (i.e. button) to work in isolation from the other.

Can you please explain to a slightly more granular detail how I can go about this in practice?

Also, how is it possible to set it up such that the sign in process is mutually exclusive- i.e. authentication via Fb no longer allows same user to create a separate account via email, or authenticate through Google+. I’m expecting the answer to this to be pretty self-explanatory, but I’m still figuring Bubble out so please bear with me!

Thank you.

Sure thing. I had understood you were doing something a bit different.

To implement this, simply create a separate workflow to be triggered when each button is selected. Right now, you have 1 workflow for “When Button SETUP MY ACCOUNT is clicked” so just copy that twice and reference the other 2 buttons within those workflows. As such, the a different workflow will be triggered when someone clicks each of the other buttons.

Then, update the action for each as well. Right now, you have the action “Signup/login with Google Calendar” so you’ll want to change that to a different action for the Facebook login workflow. Same goes for Create an Account with email.

Does this help?

Yes! Lo and behold I ended up doing just this as I didn’t know any other way around it - thanks for confirming that it was the right approach to take.

Appreciate the help- thank you @sridharan.s!

1 Like

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