docs
docs copied to clipboard
Next.js example causes an infinite loop of rerendering
Preflight checklist
- [X] I could not find a solution in the existing issues, docs, nor discussions.
- [X] I agree to follow this project's Code of Conduct.
- [X] I have read and am following this repository's Contribution Guidelines.
- [ ] This issue affects my Ory Cloud project.
- [ ] I have joined the Ory Community Slack.
- [ ] I am signed up to the Ory Security Patch Newsletter.
Describe the bug
useEffect
is missing a second parameter (an empty array I reckon? I'm not sure as I don't have much experience with React) in Next.js example tutorial - causing the page to send a GET
request to http://localhost:3000/api/.ory/sessions/whoami
every few hundred miliseconds. Unless that's an expected behaviour?
Reproducing the bug
Follow the tutorial, log in and open "developer tools" -> "network" tab to see lots of requests. Providing an empty array as a second parameter to useEffect
fixes the issue.
Relevant log output
No response
Relevant configuration
No response
Version
N/A
On which operating system are you observing this issue?
No response
In which environment are you deploying?
No response
Additional Context
No response