PricingDocsAcademy
Bluesky ...
Wed, Dec 11, 10:51 PM

Issue with receiving authToken in Toddle

  • /attachments/1298201720618225715/1298221672611975198/Capture_decran_2024-10-22_104753.png

    FARES

    1 month ago

    I'm having an issue with integrating Toddle and Xano for a signup page. The API works fine, and when I make a POST request directly via cURL or Postman, I receive the authToken in the response as expected.

    However, when I trigger the same request through a button in Toddle, I’m not receiving the authToken in the response under data. I’ve checked the API call (URL, POST method, headers, and body), and everything is configured correctly. I also verified that the JSON response from Xano includes the authToken.

    If anyone has suggestions on what might be causing this or how to properly capture the response in Toddle, I'd appreciate the help!
    Capture_decran_2024-10-22_104753.png
    1
  • /attachments/1298201720618225715/1298292599265955912/image.png

    Sean

    1 month ago

    One thing I usually do when I encounter issues like this is, is to inspect the request on the Xano side. It helps me to see what Xano received as inputs in the API call. Can you share a screenshot of a specific request from the request history as in the screenshots.
    image.png
    image.png
    image.png
  • FARES

    1 month ago

    thanks for your retur sean
  • image.png
  • Sean

    1 month ago

    Okay so Xano is receiving a bad request. Can you click the first item in the request history so that it shows the details. After you click the first "400 Bad request", expand the Input and Output in the details...
  • /attachments/1298201720618225715/1298296508847751280/image.png

    FARES

    1 month ago

    for your information i tried to do some request manuely on xano and with powershell
    image.png
  • Sean

    1 month ago

    Can you expand input and output and share a screenshot please
  • /attachments/1298201720618225715/1298296939124883516/image.png

    FARES

    1 month ago

    image.png
  • Tod

    1 month ago

    Great energy @FARES! Your continuous contribution to the toddle Community just made you advance to Community Level 1!
  • Sean

    1 month ago

    Oh and sorry. Make a request from Toddle not Postman or something else. You want to look at the input and output for a request made from your Toddle app
  • FARES

    1 month ago

    yes i did it but its not working that's the issu
  • thats why i tried with postman and debug with xano
  • Sean

    1 month ago

    No I mean make a request from your Toddle app, refresh the Request history (it takes a few seconds for the request to show up in the request history and you need to refresh it) and inspect the input and output
  • FARES

    1 month ago

    okey
  • /attachments/1298201720618225715/1298298368363200612/image.png

    Sean

    1 month ago

    image.png
  • /attachments/1298201720618225715/1298298512026501151/image.png

    FARES

    1 month ago

    image.png
  • i did it but like you see the last request is at 8:40 and now its 15
  • Sean

    1 month ago

    Click on the top request to view the details. Make sure that the top request is the one sent from your Toddle app (not via Postman or anything else). Once you click on it, expand the Input and Output...
  • Sean

    1 month ago

    Also, can you share a screenshot of the entire API request set up in Toddle. I couldn't see the entire set up in your original screenshot to see the "Body" of the request.
  • /attachments/1298201720618225715/1298300100392517732/image.png

    FARES

    1 month ago

    image.png
    image.png
    image.png
  • /attachments/1298201720618225715/1298300636676227102/image.png

    Sean

    1 month ago

    So your request history says that the name is blank and the email is blank. So although your request is hitting your endpoint, Xano is responding with a "Bad Request" because it says missing parameters (I suspect name and email). I can't see where in your API set up are you passing the name, email, and password in the request. Can you scroll down to the body of the API set up in Toddle like in this image
    image.png
  • /attachments/1298201720618225715/1298300888204574771/image.png

    FARES

    1 month ago

    image.png
  • Sean

    1 month ago

    Okay good. Now can you click on the (fx) to open up what this Body object is made up of and share a screenshot please
  • FARES

    1 month ago

    i already share it
  • image.png
  • /attachments/1298201720618225715/1298302845208232078/image.png

    Sean

    1 month ago

    Okay. Can you make a request and immediately after that open up the Body in the formula editor. It should show the name email and password filled out (your screenshot shows them empty). Also expand the output node. They should have values if your variable setup is correct. Like in this image.
    image.png
  • FARES

    1 month ago

    ok i ll do
  • image.png
  • empty
  • Sean

    1 month ago

    Hmm. Okay. And I think if you expand the output node, that is empty too, can you confirm?
  • FARES

    1 month ago

    yes
  • Tod

    1 month ago

    Great energy @FARES! Your continuous contribution to the toddle Community just made you advance to Community Level 2!
  • Sean

    1 month ago

    So your API setup looks fine to me. The next thing to check if the Name, Email, and Password variables are being set correctly. Can you share a screenshot of the input fields in your Toddle app where your variables are being set and how you are setting these values from the input field
  • FARES

    1 month ago

    ok
  • Max

    1 month ago

    Is this a public project? If so, you can share the link and we can check the setup of the editor
  • FARES

    1 month ago

    yes
  • it s public
  • Sean

    1 month ago

    Can you share the latest request history (expanded) in Xano
  • FARES

    1 month ago

    yes
  • /attachments/1298201720618225715/1298306187330191401/image.png

    FARES

    1 month ago

    image.png
  • Max

    1 month ago

    You never actually call the api. The submit event has to be on the form, not the button. And the button needs the attribute "type=submit"
  • Sean

    1 month ago

    Can you try what Max suggests and let us know.
  • FARES

    1 month ago

    yes i am trying
  • FARES

    1 month ago

    the button is already "type=submit"
  • FARES

    1 month ago

    now th button it s not cliquable
  • Sean

    1 month ago

    Works for me
  • image.png
  • FARES

    1 month ago

    with my account ?
  • /attachments/1298201720618225715/1298308086523494460/image.png

    Sean

    1 month ago

    image.png
  • The public app you shared works for me 🙂
  • /attachments/1298201720618225715/1298308202500194344/image.png

    FARES

    1 month ago

    image.png
  • and for me now thak you a lot sean and max
  • Sean

    1 month ago

    Sure. No problem. Have fun toddle away 🙂
    ❤️1
  • FARES

    1 month ago

    i am very happy thank you
  • Max

    1 month ago

    Sure 😊
  • FARES

    1 month ago

    thank
  • Sean

    1 month ago

    I'm curious to know this too. Does this matter? I mean eventually, the Submit button calls the signup API call which has the params as expected -- so shouldn't that trigger the API anyway or is that because there's a Prevent default and so the button wouldn't do what its meant to do and rely on the form's submit event -- is that it?
  • Max

    1 month ago

    The button does not throw a "submit" event. Only the form does. So this will never be called. If you have a click event on the button, it would work. But that's not good practice
  • Sean

    1 month ago

    Ah! That makes sense. Completely overlooked that. Thanks Max.
    💪1
  • Tod

    1 month ago

    Great energy @Sean! Your continuous contribution to the toddle Community just made you advance to Community Level 9!

Stop scrolling. Start building.

toddle is a visual web app builder that rivals custom code — but accessible to your entire team!

Try toddle — it's free!

© Copyright 2024 toddle. All rights reserved.