Not being able to use Bearer access_token after login with Supabase

  • roccons-1266105572126888046

    roccons

    6 months ago

    I already have a succesuful login and I'm getting my Bearer access_token within the response data, but I'm not being suceessful at saving it as a Session cookie so when I try to use it in another API request using Bearer access_token for Authentication I get a 401 error with the message "This endpoint requires a Bearer token". What I am missing?
    I attach some images of the configuration of my two API requests.
    1266105572319563838-Screenshot_from_2024-07-25_12-43-13.png
    1266105572596645960-Screenshot_from_2024-07-25_12-43-45.png
    1266105572969812059-Screenshot_from_2024-07-25_12-50-23.png
  • lucasg-1266108901347299419

    Lucas G

    6 months ago

    Start with the basic checks:
    Are you logging in on the preview site instead of the editor?
    Is the toddle extension installed?
  • roccons-1266109661518757971

    roccons

    6 months ago

    Thanks Lucas. I have the extension installed. With preview site you mean the toddle.site in another browser tab?
  • roccons-1266110777929236611

    roccons

    6 months ago

    I've tried both login with the preview mode within the editor, and in the preview site. But I'm checking the request for the list users endpoint only inside the editor because I've not added it to the UI yet.
  • roccons-1266113248504053871

    roccons

    6 months ago

    Oh but I see the extension is disabled in my editor tab, I had the idea that the extension was active inside the editor. Is that the problem?
    1
  • roccons-1266113835136192552

    roccons

    6 months ago

    If that's the case how could I use authenticated requests within the editor?
  • roccons-1266115649458012212

    roccons

    6 months ago

    Also, I can't access the data child nodes of the response if I can't use the authentication inside the editor
  • roccons-1266116991832424469

    roccons

    6 months ago

    I've also checked that the values I insert in the preview site aren't passed to the editor, no matter the extension is active in the preview tab.
  • roccons-1266117316987322440

    roccons

    6 months ago

    I already tried in different ways but I keep getting the 401 "This endpoint require a Bearer token"
  • Tod-1266117318711443559

    Tod

    6 months ago

    Great energy @roccons! Your continuous contribution to the toddle Community just made you advance to Community Level 4!
  • roccons-1266118439185940542

    roccons

    6 months ago

    I can also confirm that if I make the request in Postman, using the acces_token I get in toddle, the request works just fine
  • lucasg-1266119635930058782

    Lucas G

    6 months ago

    You open up the preview site (toddle.site) and login in there
  • Once you do that, you refresh the editor and the extension handles the token access
  • This is the way to do it for now until the new extension comes along
  • roccons-1266121035791466599

    roccons

    6 months ago

    it worked, thanks!!
    👍1

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.