Next.js Discord

Discord Forum

Routing in server actions

Unanswered
Erythrina gall wasp posted this in #help-forum
Open in Discord
Erythrina gall waspOP
Hello, i'm fairly new to Next, using the app directory and the new "server actions". I'm using prisma in my App, and I currently have a form that create a user when submited. I wanted to know if there was a way to redirect me to another page when the user is created in the server action ? Router.push is only client side, and wanted to know if there was a way to handle it in a server action, thanks !

2 Replies

You can use redirect() from next/navigation
Erythrina gall waspOP
Thanks a lot!