Issue with receiving authToken in Toddle

  • fares_2020-1298201720618225715

    FARES

    5 months 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!
    1298221672611975198-Capture_decran_2024-10-22_104753.png
    βœ…1
  • burner918-1298292600440094823

    Sean

    5 months 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.
    1298292599265955912-image.png
    1298292599823667325-image.png
    1298292600280973434-image.png
  • fares_2020-1298294212894265444

    FARES

    5 months ago

    thanks for your retur sean
  • 1298294231525359646-image.png
  • burner918-1298295718813110354

    Sean

    5 months 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...
  • fares_2020-1298296509036625971

    FARES

    5 months ago

    for your information i tried to do some request manuely on xano and with powershell
    1298296508847751280-image.png
  • burner918-1298296743347359795

    Sean

    5 months ago

    Can you expand input and output and share a screenshot please
  • fares_2020-1298296939334336513

    FARES

    5 months ago

    1298296939124883516-image.png
  • Tod-1298296940965920828

    Tod

    5 months ago

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

    Sean

    5 months 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_2020-1298297376880066682

    FARES

    5 months ago

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

    Sean

    5 months 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_2020-1298298100548636683

    FARES

    5 months ago

    okey
  • burner918-1298298368891551868

    Sean

    5 months ago

    1298298368363200612-image.png
  • fares_2020-1298298512232157215

    FARES

    5 months ago

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

    Sean

    5 months 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...
  • burner918-1298299580420718612

    Sean

    5 months 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.
  • fares_2020-1298300101000953938

    FARES

    5 months ago

    1298300100392517732-image.png
    1298300100703027299-image.png
    1298300101084581948-image.png
  • burner918-1298300636877819925

    Sean

    5 months 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
    1298300636676227102-image.png
  • fares_2020-1298300888250581096

    FARES

    5 months ago

    1298300888204574771-image.png
  • burner918-1298301079515037859

    Sean

    5 months 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_2020-1298301219055341648

    FARES

    5 months ago

    i already share it
  • 1298301342800023582-image.png
  • burner918-1298302845463953442

    Sean

    5 months 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.
    1298302845208232078-image.png
  • fares_2020-1298303101639331860

    FARES

    5 months ago

    ok i ll do
  • 1298303347580997683-image.png
  • empty
  • burner918-1298303527046873201

    Sean

    5 months ago

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

    FARES

    5 months ago

    yes
  • Tod-1298303857327079495

    Tod

    5 months ago

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

    Sean

    5 months 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_2020-1298304054375747696

    FARES

    5 months ago

    ok
  • max.kayr-1298304096432033916

    Max

    5 months ago

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

    FARES

    5 months ago

    yes
  • it s public
  • burner918-1298305215333793852

    Sean

    5 months ago

    Can you share the latest request history (expanded) in Xano
  • fares_2020-1298305802431496213

    FARES

    5 months ago

    yes
  • fares_2020-1298306187535843400

    FARES

    5 months ago

    1298306187330191401-image.png
  • max.kayr-1298306191738408971

    Max

    5 months 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"
  • burner918-1298307088828731413

    Sean

    5 months ago

    Can you try what Max suggests and let us know.
  • fares_2020-1298307188430999627

    FARES

    5 months ago

    yes i am trying
  • fares_2020-1298307510197026857

    FARES

    5 months ago

    the button is already "type=submit"
  • fares_2020-1298307830079557794

    FARES

    5 months ago

    now th button it s not cliquable
  • burner918-1298307867329298463

    Sean

    5 months ago

    Works for me
  • 1298307873138413731-image.png
  • fares_2020-1298308009403088937

    FARES

    5 months ago

    with my account ?
  • burner918-1298308086750248990

    Sean

    5 months ago

    1298308086523494460-image.png
  • The public app you shared works for me πŸ™‚
  • fares_2020-1298308202781347891

    FARES

    5 months ago

    1298308202500194344-image.png
  • and for me now thak you a lot sean and max
  • burner918-1298308453361516625

    Sean

    5 months ago

    Sure. No problem. Have fun toddle away πŸ™‚
    ❀️1
  • fares_2020-1298308519619199026

    FARES

    5 months ago

    i am very happy thank you
  • max.kayr-1298308566205071444

    Max

    5 months ago

    Sure 😊
  • fares_2020-1298308582265196729

    FARES

    5 months ago

    thank
  • burner918-1298308605723938918

    Sean

    5 months 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.kayr-1298309103742881854

    Max

    5 months 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
  • burner918-1298309451455135836

    Sean

    5 months ago

    Ah! That makes sense. Completely overlooked that. Thanks Max.
    πŸ’ͺ1
  • Tod-1298309453418070016

    Tod

    5 months 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.