DEV Community

Discussion on: The Complete Guide to Next.js Authentication

Collapse
 
wataruoguchi profile image
Wataru Oguchi

For a workaround, I found this comment.

I made the catch to return the following snippet, and I removed res.writeHead(302, { Location: '/profile' }) and res.end().

return {
  redirect: {
    destination: "/profile",
    statusCode: 302,
  },
};
Enter fullscreen mode Exit fullscreen mode