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 } })
}Discussion 0
Join free to post in the discussion.
Related questions
- Where to keep a secret keyFull Stack Developer
- Status 401 vs 403Full Stack Developer
- useState in an App Router pageFull Stack Developer
- Renaming a secret to NEXT_PUBLIC_Full Stack Developer
- Making a route publicFull Stack Developer
- What a layout doesFull Stack Developer
- Route for a product IDFull Stack Developer
- Folders in parenthesesFull Stack Developer