Action triggering revalidation without cookie
I am implementing an admin site which uses BetterAuth. When implementing an action it seems it tries to fetch fresh data (my createAsync call) but it fails my admin validation because the cookie doesn't seem to be present. Not quite sure how I get around this. The isAdmin function is shown below (it gets called by functions in a "use server" context).
1 Reply
I worked around this by disabling revalidate in the response and then manually calling revalidate on the client... Seems like a potential bug to me.
Just an update for anyone that is curious. I started a new project to try and replicate this issue more simply so that I could get someone to help or look into it further. The issue no longer occurred. The difference? In the latest version of solid router 'cache' is deprecated and 'query' is the replacement. This issue doesn't happen with query. So upgrading to the latest version and switching to query resolved the issue that I had. Happy days! I actually went so far as trying to read the source code for useAction to see what was going on under the hood 🥲