Capturing User Consent

When using the Pathfix Custom oauth option, there may be times when you may need to capture the user consent status (if they have connected their accounts or not).

The following documentation walks you through on checking and updating the user consented status against your user in bubble.io



Create Custom Field

We start by adding a custom field to your user data

  • In Bubble.io, go to Data and User data
  • Click on Create a new field and add the provider name



Document image



Workflow

After you have set up your custom oauth buttons and the workflows as per the documentation here Custom OAuth Button add the following workflows:

In this example, we will go through the process using Google Calendar as an example.

Connected Workflow

This workflow will check the consented status (where the user is connected)

  • Add new workflow
    • Elements -> Pathfix Custom User Consented
Document image



  • Step 1 would be to Make changes to current user
    • Click on the + Change another field
    • Select the created Custom field Google connected is equal to yes
    • Add a condition to change Only when the consented provider matches (in this example we have used googlecalendar)

Note: If you are working with more than 1 provider, you can add additional Step's and repeat the same condition

Document image



Disconnected Workflow

This workflow will check if the user connection has disconnected the provider from your app.

  • Add new workflow
    • Elements -> Pathfix Custom Disconnected



Document image



  • Step 1 would be to Make changes to current user
    • Click on the + Change another field
    • Select the created Custom field Google connected is equal to no
    • Add a condition to change Only when the consented provider matches (in this example we have used googlecalendar)

Note: If you are working with more than 1 provider, you can add additional Step's and repeat the same condition

Document image



Using the Consented Status

You can add workflows to show/hide elements on your page depending on the user's consented status for a provider.

Example: show the Disconnect button if the user is connected and hide the Connect button.

Document image



Show Connect button if the user is disconnected and hide the Disconnect button

Document image



The Consented status updates automatically based on the connection status of the user. No additional calls need to be made.







Need help? Reach out to us at support@pathfix.com and we would be happy to assist!