-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CustomPage will prompt MissCSRF, and the page will refresh normally after refreshing #11726
Comments
https://authjs.dev/guides/pages/signin I am using this page's demo |
This problem has been around for a while, and nobody seems to take action about it, i don't know, maybe it has become a feature. |
Too bad, can't anyone answer? |
#11713 I found that this jump error is the cause |
This appears to still be broken, can someone take a look please. In particular, the Missing CSRF error appears if you have a custom signin pages. Steps to reproduce are:
|
Currently, this can be solved by using the signin on the client side. import { signIn } from "next-auth/react"; |
I think I might have this working now. In my case, my middleware was pointing to the original signin url rather than my custom page. I factored this out into constants to make it clearer where my code was using each URL. I've shared an example repo which shows how I managed to get it to work. https://github.com/jr200/nats-skeleton-nextjs @liuhuapiaoyuan I'd be interested to hear if your issue is different from mine, or if you think i'm doing something unusual/incorrect. |
I think I might have this working now. In my case, my middleware was pointing to the original sign-in URL rather than my custom page. I factored this out into constants to make it clearer where my code was using each URL. I've shared an example repository that shows how I managed to get it to work. https://github.com/jr200/nats-skeleton-nextjs I would be interested to hear if your issue is different from mine, or if you think I am doing something unusual or incorrect. ??, It should not have this problem if |
Environment
Reproduction URL
https://github.com/liuhuapiaoyuan/nextjs-auth-misscsrf
Describe the issue
The code is exactly the same as the official demo, but it still prompts MissCSRF
How to reproduce
Expected behavior
Stop missing CSRF at this time!
The text was updated successfully, but these errors were encountered: