Nextjs dynamic route page return 403 Forbidden error for only one specific user dynamic route #45437
-
I have my route defined as When I tried to access one of the specific active userID (eg. patients/7917067d) it gave FYI, when I enter the wrong userId it gives 404 which is correct behaviour but don't know why only this userId which is correct gives a 403 error. NOTE: I am using Static Generation with Client-side data fetching EDITED: There is a sentry error also which I think relates to the same problem: |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 11 replies
-
That 403 forbidden looks nothing like Next.js' error layout, could you share what headers you get back from this request? Of course do, remove sensitive data. |
Beta Was this translation helpful? Give feedback.
-
@icyJoseph Upgrading the nextjs package to 12.3.3 did the work. Thanks for your effort. Appreciate it. |
Beta Was this translation helpful? Give feedback.
-
@icyJoseph I just noticed this issue in a different way. When I go through the link to that route it works fine but when I directly enter that URL in a browser or refresh the page it gives |
Beta Was this translation helpful? Give feedback.
-
If somebody else stumbles upon this. I had this problem when using Fixed it by adding new default index files (index.html is standard) and in my case next generated a file in subfolder with a file called Adding the following line to the
|
Beta Was this translation helpful? Give feedback.
-
This is still not working with next.js 15.1.4 LOL |
Beta Was this translation helpful? Give feedback.
@icyJoseph Upgrading the nextjs package to 12.3.3 did the work. Thanks for your effort. Appreciate it.