react-turnstile icon indicating copy to clipboard operation
react-turnstile copied to clipboard

🐛 Bug: When using the Turnstile component, if you stay on a page for too long, useNavigate will fail.

Open wzl13211 opened this issue 1 year ago • 6 comments

Bug Report Checklist

  • [X] I have tried restarting my IDE and the issue persists.
  • [X] I have pulled the latest main branch of the repository.
  • [X] I have searched for related issues and found none that matched my issue.

Expected

Ability to use useNavigate

Actual

Ability to use useNavigate

Package Version

1.0.0

Browsers

Chrome

Additional Info

No response

wzl13211 avatar Sep 05 '24 02:09 wzl13211

It is possible that the page has been inactive for a long time (for example, after being idle for a period of time), and the Turnstile session may have expired?

wzl13211 avatar Sep 05 '24 08:09 wzl13211

You will still find this problem when using a vanilla Turnstile Widget,

wzl13211 avatar Sep 05 '24 09:09 wzl13211

Hey!

What do you mean with useNavigate? Is this something related to an specific framework?

It is possible that the page has been inactive for a long time, and the Turnstile session may have expired?

Probably, not sure. In that case you can try the .isExpired() and .reset() methods.

You will still find this problem when using a vanilla Turnstile Widget

If the problem happens using a vanilla Turnstile Widget too, may not be able to fix it in the library, but we can try to find a solution together.

marsidev avatar Sep 05 '24 16:09 marsidev

Just use the browser's rollback function 。 such as window.history.back

wzl13211 avatar Sep 06 '24 01:09 wzl13211

I can't reproduce the error

marsidev avatar Sep 06 '24 20:09 marsidev

When I use it, it will load a js file, and I found that window.history.pushStat is rewritten in the file. Is this the reason?

wzl13211 avatar Sep 11 '24 08:09 wzl13211