PricingBlog

Session cookies not working on editor

  • victoruxui-1252292252093648926

    Victor Giron

    1 year ago

    I have a page "access" for user login, and a page "dashboard" to show a list of items.
    The list of items comes from a Supabase table with row level security for auth users.

    My issue is that when I login in editor the list doesn't load, but in the preview link "production" does work normally.
  • petermac7886-1252325065878405252

    petermac

    1 year ago

    I had a similar issue. Installing the Toddle Chrome plugin sorted it for me.
  • victoruxui-1252326557385621604

    Victor Giron

    1 year ago

    I have it installed but is not working for some reason, do you have RLS enabled?
  • petermac7886-1252327756633604218

    petermac

    1 year ago

    Yes I have RLS enabled. Sometimes it glitches out and closing the browser and reopening it works. Especially if you login with one user then logout and login as a different user, it doesn't work in the editor for me anymore but closing the browser then reopening browsers sorts it for me
  • livia092957-1259857888109793370

    livia

    1 year ago

    Hey! I'm having the same issue both on Arc (Chrome) and Firefox and can't get it to work on the editor, although it works fine on the actual preview page, like @Victor Giron mentioned. Did you manage to fix your problem?
    I'm setting the cookies on the /sign-in page, then redirecting to the root page. The root page then checks the /me endpoint to see if the user is logged in, and if not it redirects to the /sign-in page. So I'm stuck in a loop where I can't edit the root page (unless I stop redirecting). I'm also having to manually add the auth token as a header whenever I request anything from my Xano API, as the editor isn't storing the token in the cookies.
    Any ideas?
    🙌1
  • livia092957-1259858445427806298

    livia

    1 year ago

    (I've installed the extension for both browsers)
  • victoruxui-1259871942346014750

    Victor Giron

    1 year ago

    Not sure if this a thing or we're missing something @Andreas Møller ?
  • andreasmoller-1259873483865980958

    Andreas Møller

    1 year ago

    Ill flag it with the team
    🙌1
  • livia092957-1259931228933455953

    livia

    1 year ago

    thanks, Andreas! let me know if you need any extra info for debugging
  • erikbeus-1260138118238179418

    Erik Beuschau

    1 year ago

    @Victor Giron @livia did you try logging in on the preview url (<your-branch>-<your-project-id>.toddle.site)? We use the same extension/process internally, but we are also working on updating the browser extension to better support authenticated apps in the editor.
  • livia092957-1260153462792912948

    livia

    1 year ago

    hi @Erik Beuschau , the preview url works fine, I can login and navigate through the pages without losing the cookie. it's just the editor that's the problem. it's a big problem though, because like I said the 'protected routes' (which redirect if /me doesn't return a user) won't let me edit the page's content, as the editor does do the redirect bc I'm not logged in.
    so for example, every time I try to edit the dashboard page, it keeps sending me to the sign in page. so I need to manually disable the /me call on the editor for every page and remember to re-enable when I'm done
  • erikbeus-1260154027623059579

    Erik Beuschau

    1 year ago

    I see. That does sound annoying 🤔 Could you invite me to your project and perhaps send me a DM with some credentials so I can reproduce this issue? 🤞
    My toddle username is: god_of_code
  • livia092957-1260156876545331230

    livia

    1 year ago

    I've invited you, let me know if it worked!
  • Tod-1260156878088835072

    Tod

    1 year ago

    Great energy @livia! Your continuous contribution to the toddle Community just made you advance to Community Level 1!
  • erikbeus-1260156962625294337

    Erik Beuschau

    1 year ago

    I was invited for your org 👍 Could you also invite me for the project? 🤞
  • livia092957-1260157253236035615

    livia

    1 year ago

    I think I did just now, can you check? it didnt give me feedback in the ui so dont know if it worked
  • erikbeus-1260157495759077461

    Erik Beuschau

    1 year ago

    It worked, thank you. We will improve the feedback for project invites 😅
    Could you DM some credentials that I can use to test with?
  • livia092957-1260157559860625458

    livia

    1 year ago

    haha no worries! yeah
    🙌1
  • victoruxui-1266524832510771323

    Victor Giron

    1 year ago

    Hey @livia did you find a solution to the issue? I'm still having this issue on my end
  • lucasg-1266530069254377522

    Lucas G

    1 year ago

    How do you login? On the preview site then refresh editor?
  • victoruxui-1266581720241672365

    Victor Giron

    1 year ago

    I login on the editor page "/login" and then go to the editor page "/dashboard" this works fine on the preview link, but not in the editor, in the editor I find impossible to keep my user logged in
  • lucasg-1266582015466143855

    Lucas G

    1 year ago

    You can't log in inside the editor. You have to login in on the preview site
  • After you log in on the preview site, you refresh the editor and it should work
  • victoruxui-1266584846776401972

    Victor Giron

    1 year ago

    I tried that a second ago but still not working
    1266584846554239109-image.png
  • lucasg-1266585778319003749

    Lucas G

    1 year ago

    JWT expired is interesting. What do you set as the expiry when setting the token?
  • I just leave it blank lol
  • It works but only for supabase. Either way, setting it with the API call should work too 🤔
  • lucasg-1266756740074963035

    Lucas G

    1 year ago

    Parce did you fix this? How long have you been dealing with not keeping a log in for?? 😭
  • victoruxui-1266756957600092192

    Victor Giron

    1 year ago

    Not yet parcero, for months now. I tried this and didn’t work
  • lucasg-1266757269086011413

    Lucas G

    1 year ago

    Get someone from the team to look at it, that sounds annoying to build with if you can’t log in
  • andreasmoller-1266757405358686289

    Andreas Møller

    1 year ago

    We are working on an updated version of the plugin that will let you know when it is installed, and when you have an active token.
  • @Victor Giron I am happy to take a look if you invite me to your project
  • lucasg-1266757740609405083

    Lucas G

    1 year ago

    The new extension version will be great but the current one does work though. Very weird he’s getting those issues
  • andreasmoller-1266758994802905140

    Andreas Møller

    1 year ago

    It does, but as you said, it does not let you set the cookie from the editor, and it is not easy to see if the cookie is set.
  • victoruxui-1266765183708303380

    Victor Giron

    1 year ago

    Awesome, thank you Andreas, as soon as I get home I’ll share access with you
  • patrickmast-1267026860630478899

    Patrick Mast

    1 year ago

    @Andreas Møller Is this the same problem I encounter when deploying my app into another web app, where my app resides in the iFrame of that web app? It appears that setting a cookie also doesn't work when an app is in an iFrame. If this is the case, what is the solution?
  • andreasmoller-1267033837783748690

    Andreas Møller

    1 year ago

    Yes, cookies are blocked when running inside an iframe. Our browser plugin is solving that
    👍1