Skip to content
Discussion options

You must be logged in to vote

You should just move this logic:

const info = Info.findOne({session?.user?.email})

directly into getServerSideProps.

It is generally not recommended to fetch your api from getServerSideProps.

You can create a shared module if you still need that api endpoint for other reasons instead.

Ref: https://nextjs.org/docs/basic-features/data-fetching#getserversideprops-server-side-rendering

Check the Note

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by srcnalt
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