Загрузка видео...

Не удалось загрузить видео

На главную

Secure your server actions

75,025 просмотров • 11 месяцев назад •via X (Twitter)

Комментарии: 10

Фото профиля Alex Sidorenko
Alex Sidorenko11 месяцев назад

Nuance: action ID is a unique hash. If you don't render it (like in the example when the user is not an admin), it would be hard to trigger your endpoint But in any case, server actions always create endpoints, and endpoints should be protected

Фото профиля Eduardo Borges
Eduardo Borges11 месяцев назад

damn... i probably missed that one in some project though I try to keep the actions inside a ./actions/delete-stuff.ts with 'use server' works right?

Фото профиля Alex Sidorenko
Alex Sidorenko11 месяцев назад

"use server" only ensures that the code in marked file never gets into the client-side js bundle You still need to protect your server actions as if they are separate callable endpoints (because they are)

Фото профиля Iaci
Iaci11 месяцев назад

I (who separates front- and backend) dont understand this

Фото профиля Ᵽøłskɨ Ƀøɍsȼħ
Ᵽøłskɨ Ƀøɍsȼħ11 месяцев назад

...or next-safe-action does this trick for you 😉

Фото профиля yo puaaa 👋
yo puaaa 👋11 месяцев назад

Too many people thought server actions were a magic black box that just made things work, without realizing it's just magic POST calls!

Фото профиля Daniel Still
Daniel Still11 месяцев назад

I love Next overall, but it's a way better experience to just use Route Handlers. Especially if you plugin a framework like Hono or Elysia for good conventions and plugins out of the box.

Фото профиля Legion Dev
Legion Dev11 месяцев назад

well its same like secure your api end point lol

Фото профиля Ruchir
Ruchir11 месяцев назад

I wonder how many security issues modern Next has created due to server actions lol.

Фото профиля Aurora Scharff
Aurora Scharff11 месяцев назад

Also this

Похожие видео