Skip to content

Unknow error on api route for oauth on next.js app router and type error with cookies #637

Closed Answered by perrylets
perrylets asked this question in Help
Discussion options

You must be logged in to vote

The problem was with the redirect url, because behaviours where the documentation is only easy to find after the error ocurrs are my favorite.

I fixed it by doing this instead of the previous redirect

return NextResponse.redirect(new URL("/", req.nextUrl.hostname), {
  status: 302
});

Replies: 5 comments 15 replies

Comment options

You must be logged in to vote
9 replies
@pilcrowonpaper
Comment options

@perrylets
Comment options

@pilcrowonpaper
Comment options

@perrylets
Comment options

@pilcrowonpaper
Comment options

Comment options

You must be logged in to vote
2 replies
@pilcrowonpaper
Comment options

@perrylets
Comment options

Comment options

You must be logged in to vote
1 reply
@perrylets
Comment options

Comment options

You must be logged in to vote
2 replies
@pilcrowonpaper
Comment options

@perrylets
Comment options

Comment options

You must be logged in to vote
1 reply
@pilcrowonpaper
Comment options

Answer selected by perrylets
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants