Skip to content
RED SAGSkills
medium10 pts · first answer countsnextjsauthorizationserver-actions

Hiding the button is not auth

A Next.js Server Action deleteProject(id) is only rendered on the admin page, so it has no permission check inside. Why is this unsafe?

'use server'
export async function deleteProject(id: string) {
  await db.project.delete({ where: { id } })
}
Choose one answer

Discussion 0

Join free to post in the discussion.

Related questions