Updating the server sessions from serveractions or routehandlers in nextjs. #11454
amrathhugo
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Goals
Non-Goals
Background
I was writing axios interceptors to make api calls from the nextjs application. I am attaching the session stored id to the request headers in the interceptor each time and checking for response, if the request is unauthorized. If i get unauthorized i had to refresh the tokens using refresh token stored in the session.
As these axios interceptors written as server actions we can't able to update the newly fetched tokens in to the session.
Looking up for a discussion on this!
Thanks
Proposal
I was writing axios interceptors to make api calls from the nextjs application. I am attaching the session stored id to the request headers in the interceptor each time and checking for response, if the request is unauthorized. If i get unauthorized i had to refresh the tokens using refresh token stored in the session.
As these axios interceptors written as server actions we can't able to update the newly fetched tokens in to the session.
Looking up for a discussion on this!
Thanks
Beta Was this translation helpful? Give feedback.
All reactions