Bubble API connector

Options
Hi Guys, I really need your help!!

I'm building an application using Bubble on the front and Xano on the back.

To authenticate users, I'm saving the authentication token in local storage (using a plugin according to Michael's tutorial).

When I make the get request to use the token that was saved, the Bubble API connector is not sending the dynamic data with the token to Xano. Instead, bubble is sending the example token that is saved in the API configuration.

Has anyone ever had a similar problem?

Comments

  • Felipe Letelier
    Options
    Hi Fernando, if you have exposed the parameter to the front end and you are sending the dynamic data through the API call, my guess would be that you think you are sending it correctly, but you are not actually loading the token to the call. I would suggest you to:
    • Create a text field and display the token in there to check if you are calling it properly. If the text displays nothing, it means that the dynamic search you are doing is not working as expected.
    • Create a hidden variable (like a group in a popup) to store the token as text, and make the call retrieving the token from the variable, this would avoid asynchronous weird behaviors.

    If none of these solutions fix your problem, you could share a couple of screenshots of your setup to see what is going on.

    Cheers!
  • Fernando Andrade
    Options
     Thank's for help.

    I created two test pages without the other workflows to make the problem easier to see:

    1) - API Connector configuration:[01 - API Connector configuration.jpg]2) Page 1 workflow:[02 - Page 1 workflow.jpg]3) Page 2 workflow:[03 - page 2 workflow.jpg]4)Page 1 steps on debug mode:[04 - Page 1 steps on debug mode.jpg]5)Page 2 steps on debug mode:[05 - Page 2 steps on debug mode.jpg]
  • Fernando Andrade
    Options
    I already tried with Michael's Tutorial Free Plugin and with this other paid plugin.

    And I tried to do as you said, sending the token indirectly, through a custom state of type text.
  • Fernando Andrade
    Options
    Authentication works normally if I pass the token directly from the login result or passing it as a parameter of a URL. But that would make me lose the possibility of a persistent authentication.
  • Lachlan McPherson
    Options
    Hi Fernando, 

    We are experiencing the exact same issue, with 2 separate Local Storage plugins. We've bypassed this temporarily by creating a user within bubble and storing the auth token as a database record. 
  • Fernando Andrade
    Options
    I found that the api works perfectly if I use the auth/me request configured as a data api in the bubble. This setting resolves most case uses.

    But in my case, I built a bit more elaborate authentication, sending a magic link to confirm the user's email. In this case I need to use auth/me as an action in the workflow, to send the user back to the sign-up page if they haven't completed the account verification.

    When changing the auth/me configuration in the Bubble to "Action", the Bubble stops sending the dynamic content of the header parameter (authtoken), and sends the token registered as an example in the Api Connector configuration.

    Does anyone have any suggestions?
  • Fernando Andrade
    Options
    Guys, problem solved. It was a matter of synchronization. The reason for the error was to put this action right after the action of "retrieving data from local storage".

    I managed to solve it by creating a new conditional trigger: "Do it only when the local storage is not empty". And in the trigger "load page" I left only the action of "recover from local storage"  😅
  • Felipe Letelier
    Options
     Hey, I noticed that your Auth parameter in the header is missing the "Bearer" string like in the image bellow: [image.png]That should fix the problem 😃

    Also, as a tip, I suggest you to pass the Authorization parameter in a shared header, that way you don't have to add/change it for each call you create!
  • Moabe Vettore
    Options
    Hi Fernando, how are you?

    My name is Moabe, I'm from Rio de Janeiro. I'm trying to send data from bubble to Xano using the API connector and POST API , but when I'm sending the parameters, I'm trying to send the dynamic parameters using the <>, but it gives an error. When I go without the dynamic parameters, it works. Do you know what it could be?
  • Fernando Andrade
    Options
    ,

    Sorry for the delay, I was off for a while, dealing with COVID, can you give more details? show the print of the error and its configuration in the api connector? 

    I am from Manaus, Brazil.