Is there a way to not expose api routes? #12643
Unanswered
visakadivines
asked this question in
Help
Replies: 1 comment 4 replies
-
The server should guard against unauthorized access accordingly. You could do this by sending headers or cookies from client side requests, but even with those protections you'd still want the server to validate the sender so that people can't spoof headers or cookies. Usually this is done by encrypting specific information about the user, like an |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I noticed that in my production deployment if I navigate to an api route (for instance /api/user) I get back a JSON object with user information. I want to be able to call this route to fetch user information but I don’t want users to be able to navigate to the url directly either on accident or on purpose. Is there anyway to not expose the api routes and only allow the hook to access it?
Beta Was this translation helpful? Give feedback.
All reactions