Repository navigation
Redirect issue with getserversideprops #13871
Unanswered
horlaarsco
asked this question in
Help
Replies: 2 comments 6 replies
|
From your question, I'm not entirely sure what you mean, but the first problem I notice in your screenshot is that you are using https://nextjs.org/docs/basic-features/data-fetching#only-allowed-in-a-page-2 If you take a look in the docs here, you will notice it says it can only be exported from a page file, so that's the first thing I would update in your example. |
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I'm trying to redirect in login page to the home page when the cookie that verifies authentication is found. when I use getserversideprops... Page redirects on first load but when i hit refresh of the login page again i get error of header sent.. screenshot below.
All reactions