Open vnexter opened 1 year ago
Hi thanks for the very good example of creating a Nexjs app, i am having trouble creating another page i-e localhost/contacts axios api request returns 401 (unauthorised) but logged in user can access data directly from api/contacts as browser automatically sends token to api get method i guess. ( i actually copied all the (home) code to contacts without making any changes
homepage works fine i-e invoice list page loads without any issue any get-invoices api request by axios do not result in authorised.
Do you know if I missing anything,
Thank you friend. I don't have much idea what might be going wrong with your code when adding a new page. You can pass the link of your repository and I can observe more carefully what is happening.
here is the code repo https://github.com/vnexter/invapp - thanks!
I have also investigated, the issue is mainly on the pages where there are both server and client components - on server components loads and then after xhr request by axios the browser is automatically sent to localhost:3000/
hi mate, was there any luck ? i could not figure out
Hi thanks for the very good example of creating a Nexjs app, i am having trouble creating another page i-e localhost/contacts axios api request returns 401 (unauthorised) but logged in user can access data directly from api/contacts as browser automatically sends token to api get method i guess. ( i actually copied all the (home) code to contacts without making any changes
homepage works fine i-e invoice list page loads without any issue any get-invoices api request by axios do not result in authorised.
Do you know if I missing anything,