Next.js · Senior · Question 66 of 75

A Server Action deletePost(id) is used only on an admin page. Why must it still check authorization itself?

Explanation

Validate inputs (e.g. with Zod) and verify the session and permissions inside the action or in the data-access layer it calls.

Further reading

Problem with a question

Next.js · Senior · question 66

Test yourself

Take the Next.js · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz