.env.local has 2 values username and password which is secret and must not be visible to the user in the browser. I should use this data and fetch the token. The problem is env is only accessible in server and I must do server side api call only. Now the token should be accessible all over the app so I need to fetch it somewhere like _app.js but here its not supported. I found out 2 solutions.
- Client side fetch the data and use it (env variables not accessible)
- Server side fetch the data in all pages (cant do SSR in components)