Skip to content

Redirect loop when using router.push() to trigger custom signin page #2223

Answered by balazsorban44
owensco asked this question in Help
Discussion options

You must be logged in to vote

The code you provided is prone to errors. Try wrapping your if statement in the Layout component in useEffect.

By a quick Google search, I found this nice thread with an explanation

vercel/next.js#15586

Replies: 1 comment 2 replies

Comment options

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

@balazsorban44
Comment options

Answer selected by balazsorban44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
question Ask how to do something or how something works
2 participants
Converted from issue

This discussion was converted from issue #2221 on June 20, 2021 21:34.