-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Blank page with "Invalid csrf token." #14167
Comments
|
The CSRF token expired time should larger than session expired time. Then if you click the submit button, you will be redirected to a Gitea login page but not returned invalid csrf token. |
That's strange... After how long does it expire? I have just encountered it again when I opened a lot of Gitea tabs and waited for only about an hour. |
That's wired. CSRF expired time is one day. |
Encountered this again (400 Bad Request with |
Is this a new feature in 1.13.x? I didn't get it before 1.13.x. And if it expired, why the browsing is working? I get the error only when I start import new mirror: |
Have the same problem. |
CSRF is only checked on POST so GETs will not affect it. |
Could it be related to token strict attribute? |
I encounter the same problem, on version 1.13.0+rc1. I have only one Gitea tab open and the "Invalid csrf token" page appears imediately after I try to comment and review a Pull request. (for me, no need to wait an expire time to see the problem) |
Encountering the same scenario as @kevung as well on 1.13.6 for Windows. What do you guys need from us since @CL-Jeremy says you need more information in the linked PR? |
Hello everybody, |
v1.14 changed web framework from macaron to chi and modified the old csrf middleware. But I cannot ensure we fixed that. |
I just created a fresh installation of EDIT: what fixed the problem for me was to clear all cookies and site data in the firefox preferences. |
@josch solution was the key for me, I had some cookies from a previous instalation of gogs, then installed gitea in the same domain and some cookies remained (maybe the one called |
Hello, I am encountering the problem "Invalid csrf token." when I try to start the Timer on an issue. I use Gitea Version: 1.14.0+rc2 |
[x]
):Description
When clicking buttons or adding comments in issues I often see a blank page saying
Invalid csrf token.
, which I had to work around using a refresh and a re-click, which has problems such as losing text already typed up in the comments. This could be related to me using a lot of tabs.Issues that this might be related to are:
SameSite=strict
cookies instead, which seem to be able to fix this issue. Still filling this issue since this is not what a user might expect so should be better categorized as a bug than a proposal. Also, fixing this issue doesn't directly necessitate using Replace CRSF token with SameSite=strict #11188 and other fixes might be possible.The text was updated successfully, but these errors were encountered: