Hello good people!
I want to create a Next app where the session of a user is tab specific. What I mean by that is opening a new tab will prompt the user to login again. What that means in practice is that multiple app users can be logged in within the same browser window, it's a business requirement.
There is a backend Auth server which will provide a JWT token and another backend service which will provide the data.
Now the problem is I can't save that JWT token in a cookie, as cookies are shared across all tabs for a specific domain. While I can store the JWT in Session Storage, but that means I'll have to fetch the data in the client side as well, because I can't pass the JWT token to the NextJS server side. As a result, I'll have to handle the error boundaries, loading states myself and loose out a lot of benefits of server side rendering.
Is there anyone who has faced similar kind of problem before?
Or is there any way to fetch the data and render in the server?
Any help is appreciated, thanks!