PricingBlog

editor authorization problem

  • asad_90597-1282065311117475860

    asad

    1 year ago

    when a user signs in in the live app i can fetch the api from supabase (rls is enabled) and i get the data. but in the editor on the api request i get no data
    i've downloaded the toddle extension and the log in form on success saves the access token to the session cookie.
  • tomthebigtree-1282086981026840588

    Tom Ireland

    1 year ago

    Are you signing into the app in preview on the same branch you’re working on in the editor?
  • asad_90597-1282090363108200651

    asad

    1 year ago

    yes
  • tomthebigtree-1282092240637919264

    Tom Ireland

    1 year ago

    Anything specific coming back from the API request that might be a clue? What toddle browser extension do you have installed?
  • asad_90597-1282100411850821795

    asad

    1 year ago

    it just worked all of a sudden
  • tomthebigtree-1282107995957891082

    Tom Ireland

    1 year ago

    Bizarre! Good to hear it’s sorted.
  • asad_90597-1282111157812985919

    asad

    1 year ago

    wrong flag . i dont know what i did but it is not working now. i'm getting this error {"code":401,"error_code":"no_authorization","msg":"This endpoint requires a Bearer token"}
  • but if i hard code the access token as a header it works.
  • 1282111411627229328-Screenshot_2024-09-08_014925.png
    1282111411908120687-Screenshot_2024-09-08_014805.png
    1282111412319027252-Screenshot_2024-09-08_014717.png
  • tomthebigtree-1282231557112856586

    Tom Ireland

    1 year ago

    Odd. You shouldn’t need the extra authorization header in your user GET call. You mentioned you are setting the session cookies on the login request but it sounds like that’s what might be missing. You’re definitely logging in via preview (not test) on the same branch and not in the editor?