After authorization and a successful mutation, invalidate the affected data and call `redirect()`: ```ts await updatePost(input) revalidatePath(`/posts/${id}`) redirect(`/posts/${id}`) ``` `redirect()` throws a framework control-flow exception, so do not put it inside a `try/catch` that catches and suppresses it. Validate the input and perform auth inside the action before the mutation.
Installs into .claude/skills of the current project.
Are you the author of Nextjs Server Actions?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/hoangnguyen0403-nextjs-server-actions-b6e0a009)
After authorization and a successful mutation, invalidate the affected data and call `redirect()`:
```ts
await updatePost(input)
revalidatePath(`/posts/${id}`)
redirect(`/posts/${id}`)
```
`redirect()` throws a framework control-flow exception, so do not put it inside a `try/catch` that catches and suppresses it. Validate the input and perform auth inside the action before the mutation.