How i should handle the cookie change because of impersonation?
Hey devs! How i should handle the cookie (session) change because of impersonation?
Here is my current implementation:
6 Replies
actions.ts
Basically when stopping the impersonation, the session is not being updated to the old session i had before starting the impersonationYou should try window.reload before push. Also im not sure if both works in parallel.
I do this and works fine for me (reloads and loads previous session):
okay, thanks, one question, do you recoment to use tanstack/query?
Absolutely. It makes hella easier making async call on client components\
I never used it, but i will start using it now, thanks!
Yeha, learn useQuery, useMutation, stale/cache, refetching. It's really useful