Skip to content
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

"Bad Request: invalid CSRF token" when Updating branch by merge #23787

Closed
eNBeWe opened this issue Mar 29, 2023 · 6 comments · Fixed by #23790
Closed

"Bad Request: invalid CSRF token" when Updating branch by merge #23787

eNBeWe opened this issue Mar 29, 2023 · 6 comments · Fixed by #23790
Labels
Milestone

Comments

@eNBeWe
Copy link

eNBeWe commented Mar 29, 2023

Description

When clicking the "Update branch by merge" button in a pull request, I get dropped back to the main gitea page with a "Bad Request: invalid CSRF token" error message.

Gitea Version

1.19.0 as well as 1.19.0+28-g81a995cd8

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

grafik
grafik

Git Version

2.25.1

Operating System

Ubuntu Linux 20.04.6

How are you running Gitea?

Installed from binaries with systemd service behind nginx reverse proxy.
Nginx-Config is the same as given in the docs.

Database

PostgreSQL

@lunny
Copy link
Member

lunny commented Mar 29, 2023

Whether you stay the page for a long time and click the button directly when you back?

@eNBeWe
Copy link
Author

eNBeWe commented Mar 29, 2023

Happens in either case

@wxiaoguang
Copy link
Contributor

Go to your Site Admin page, do you see any error/warning message on page?

@wxiaoguang
Copy link
Contributor

OK, I understand the problem now. A regression of #22683

@lunny lunny added this to the 1.19.1 milestone Mar 29, 2023
@eNBeWe
Copy link
Author

eNBeWe commented Mar 29, 2023

For completeness: Nothing in the site admin pages.
But I guess that is kind of moot now, since you found the issue. Good job

@wxiaoguang
Copy link
Contributor

#23790 will fix the problem. Thank you for your report.

wxiaoguang added a commit to wxiaoguang/gitea that referenced this issue Mar 30, 2023
…o-gitea#23790)

Fix regression of go-gitea#22683 , it didn't pass all variables into
sub-template.

Close go-gitea#23787

After the fix, all links and the form are correct.

![image](https://user-images.githubusercontent.com/2114189/228511037-580b5f5d-43e7-494f-9b66-89f9f908e208.png)

![image](https://user-images.githubusercontent.com/2114189/228510958-f960284a-101d-4b0e-b887-80033127898d.png)
# Conflicts:
#	templates/repo/issue/view_content/update_branch_by_merge.tmpl
lunny pushed a commit that referenced this issue Mar 31, 2023
…23790) (#23825)

Backport #23790

Fix regression of #22683

Pass all variables into sub-template.

Close #23787
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants