Skip to content

Prevent duplicate form submissions when creating forks #34714

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

kerwin612
Copy link
Member

No description provided.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jun 13, 2025
@github-actions github-actions bot added modifies/templates This PR modifies the template files modifies/frontend labels Jun 13, 2025
@wxiaoguang
Copy link
Contributor

wxiaoguang commented Jun 13, 2025

I do not think we need to introduce a new mechsiam here.

You can simply use "form-fetch-action", it is already able to prevent from duplicating requests, and it is more friendly to end users.

There are examples in /devtest/fetch-action

@github-actions github-actions bot added modifies/go Pull requests that update Go code and removed modifies/frontend labels Jun 13, 2025
@kerwin612 kerwin612 force-pushed the feat/prevent-duplicate-form-submission branch from 16eaf13 to b3a0ec4 Compare June 13, 2025 13:44
@wxiaoguang
Copy link
Contributor

wxiaoguang commented Jun 13, 2025

  1. All ctx.RenderWithErr / ctx.HTML should be replaced by JSONError
  2. The test should check test.RedirectURL

@kerwin612 kerwin612 force-pushed the feat/prevent-duplicate-form-submission branch 2 times, most recently from c8d864c to 2062ab2 Compare June 13, 2025 14:17
@kerwin612 kerwin612 force-pushed the feat/prevent-duplicate-form-submission branch from 2062ab2 to 3bc926b Compare June 13, 2025 14:26
@delvh delvh changed the title Add prevention for duplicate form submissions Prevent duplicate form submissions Jun 13, 2025
@delvh delvh changed the title Prevent duplicate form submissions Prevent duplicate form submissions when creating forks Jun 13, 2025
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Jun 13, 2025
@lunny lunny added type/bug backport/v1.24 This PR should be backported to Gitea 1.24 labels Jun 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/v1.24 This PR should be backported to Gitea 1.24 lgtm/need 1 This PR needs approval from one additional maintainer to be merged. modifies/go Pull requests that update Go code modifies/templates This PR modifies the template files type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants