Magic link Xano / Bubble
Hi,
I've followed the great tutorial here https://www.youtube.com/watch?v=eWIpAPrNeuc&list=PLOch5nUqQ_Y6eyPlp15BGBlQRJjFWnmtT&index=4
But contrary to what is shown in the video, when trying to initialize the API call for /auth/magic-login, I get the following error message:
You have set the data type of this call to JSON/XML, but what is returned is not an object, but a text. Please check your settings.
Any idea?
Thanks for your help.
Best,
Comments
-
-
Hi @djcedr so this is a Bubble error because you are using selecting data type of JSON on the Bubble API connector. It sounds like what's happening is on the /auth/magic-login endpoint you are returning the raw token. You might see in the response of this endpoint it says "as self". If you update the response to give the token a key (something like authToken or token) then this will create a JSON object and should help you get around this error in Bubble.
-
Hi @Michael Udinski, thank you very much, problem solved thanks to your reply!
-
Hi @Michael Udinski and @djcedr. Could you please send pictures showing how to solve this problem?
I didn't understand how to set the solution given by @Michael Udinski -
Hey @Douglas Gouveia
No problem. So by default, the API response returns the raw value of the token. But when JSON is the data type selected in the Bubble API connector, this means Bubble is expecting a JSON object with a key-value pair.
Below is how the API is set up, returning the token as a value
Click on the response and add a name to create a key for the token.
The result looks like this:
This transforms the response from:
eyJhb…..
To
{
"token":"eyJhb…"
}
-
It still not working for me. What worked was changing on Bubble the data type from JSON to text.
The API worked by doing this, but the workflow didn't.
Categories
- All Categories
- 53 ? Announcements
- 47 ? Releases
- 37 ? Welcome
- 983 ? Help! I'm a Noob
- 125 ? No-Code Front-Ends
- 633 ? Working with APIs
- 439 ? Transforming data
- 126 ? Connect Xano to ...
- 50 ?? Find an Expert
- 348 ❓Other questions
- 35 ? Security
- 22 ✂️ Snippets
- 19 ? Showcase
- 7 ?️ Xano Chatter
- 62 ? Video Tutorials
- 171 ? Request a feature
- 229 ? Report a Bug
- 19 ? Templates & Extensions
- 7 ? Feedback