Can't fetch data on Server Components
Unanswered
LaPerm posted this in #help-forum
LaPermOP
Hi guys,
I have rolled my own auth using an express JS. Using a bearer JWT auth system. I can fetch data in my client components no issue using Axios and react-query. But if I attempt to do same fetch in a server component I get a 403 forbidden error.
I am using Zustand as a state manager and storing my access token in this state. I have also tried hard coded the accessToken into my Auth header in the server component and still get the same 403 error.
https://github.com/rsheppard-dev/next-node
I appreciate might not be a Next issue but just not me grasping something. Appreciate any help.
I have rolled my own auth using an express JS. Using a bearer JWT auth system. I can fetch data in my client components no issue using Axios and react-query. But if I attempt to do same fetch in a server component I get a 403 forbidden error.
I am using Zustand as a state manager and storing my access token in this state. I have also tried hard coded the accessToken into my Auth header in the server component and still get the same 403 error.
https://github.com/rsheppard-dev/next-node
I appreciate might not be a Next issue but just not me grasping something. Appreciate any help.
1 Reply
Greenish Elaenia
Please provide minimum code