I’m working on a Next.js basic app. The user first logs in through a separate server that handles authentication. Upon successful login, an access token is stored in the client’s session storage. For API requests from the client, I’m setting this access token in the axiosInstance headers.
Now, I want to fetch data from the same server that requires this access token for authorization during the build process using generateStaticParams to generate static pages for each post.
However, since generateStaticParams runs at build time on the server side, it doesn’t have access to the client’s session storage and also to the HTTP request.
How can I handle this situation?