ory/elements

Infinite reload loops

hyperknot opened this issue · 2 comments

Preflight checklist

Describe the bug

The default part in HandleError can cause infinite reload loops.

default:
// The flow could not be fetched due to e.g. network or server issues. Let's reload the page!
// This will trigger the useEffect hook again and we will try to fetch the flow again.
return Promise.resolve(router.reload())

I recommend changing it to the one before, where we only reload the path.

Reproducing the bug

Next.js example, go to recovery flow, manually delete the csrf cookie, reload.

Relevant log output

No response

Relevant configuration

No response

Version

master

On which operating system are you observing this issue?

None

In which environment are you deploying?

None

Additional Context

No response

I got this problem too.

This has been fixed with the latest merged code.