fireship-io / next13-pocketbase-demo

Demo for the new Next.js 13 features with Pocketbase.
271 stars 137 forks source link

Won't the "use client" inside CreateNote expose the pocketbase endpoint to the client/public #4

Open themegabyte opened 1 year ago

themegabyte commented 1 year ago

Hello Jeff!

Thank you for all the hard work you have put in your videos. They are my go to for leasure and to learn something new.

IN your latest one: https://www.youtube.com/watch?v=__mSgDEOyv8

I noticed that when you create a note you make a fetch request from the client, I am correct to assume this URL will be exposed to the public?

Link to the line: https://github.com/fireship-io/next13-pocketbase-demo/blob/main/app/notes/CreateNote.tsx#L20

Thanks again to Jeff (and to all the people more smarter then me).

ERmilburn02 commented 1 year ago

Yes, it would, if it wasn't for the fact that Jeff forgot to prevent the default behaviour of the form, causing it to refresh before it sends the request.