How to send xano user id through toddle

  • pedrocaldo-1342615465486188697

    pedrocaldo

    3 months ago

    Hello!

    I've created some DBs in Xano and their respective endpoints.

    I would like to show the content based on the authenticated user ID. I made the custom query in Xano, but I don't know which header I need to send and with which information to have access granted.

    I've tried with the authToken, but it didn't work. It keeps giving access_denied.
    1342615466090299434-image.png
    1342615466379579552-image.png
  • lucasg-1342615922707529789

    Lucas G

    3 months ago

    Can you show your headers? You should have an Authorization header in your call
  • pedrocaldo-1342868299553443923

    pedrocaldo

    3 months ago

    When the user get logged, an authtoken is save in cookies, wich is used to call the Auth API from XANO, making sure the user is authenticated. I tried to send this same authtoken with an Authorization header in my call, but didn't worked
    1342868298882351239-image.png
    1342868299213570199-image.png
  • lucasg-1342869333461700670

    Lucas G

    3 months ago

    It’s not structured correctly.
  • lucasg-1342869786907906149

    Lucas G

    3 months ago

    Your authorization header should be “Bearer access_token
  • pedrocaldo-1342876183137620101

    pedrocaldo

    3 months ago

    Sure, using this in auth Xano API i get the access.
    But the same access_token in my API DB doesn't work. Is there a reason you might know?
    1342876182693154836-image.png
    1342876182961721385-image.png
  • lucasg-1342876580543987824

    Lucas G

    3 months ago

    I think with Xano you have to specify the expiry when setting the token
  • pedrocaldo-1342882196599476285

    pedrocaldo

    3 months ago

    You mean expiration time? I've put 7 days to try, instead 24h, but also didn't worked

    I think I'll try another form of validation
  • lucasg-1342902735070171188

    Lucas G

    3 months ago

    It should ideally use the current user. There have been other threads where other Xano users have discussed this, I recommend you search through those
    🫶🏻1
  • Things like auth shouldn't be undermined