Replace the anti-CSRF token with a [cross origin protection by Go](https://go.dev/doc/go1.25#nethttppkgnethttp) that uses a stateless way of verifying if a request was cross origin or not. This allows is to remove al lot of code and replace it with a few lines of code and we no longer have to hand roll this protection. The new protection uses indicators by the browser itself that indicate if the request is cross-origin, thus we no longer have to take care of ensuring the generated CSRF token is passed back to the server any request by the the browser will have send this indicator. Resolves forgejo/forgejo#3538 Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9830 Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org> Reviewed-by: Mathieu Fenniak <mfenniak@noreply.codeberg.org> Co-authored-by: Gusted <postmaster@gusted.xyz> Co-committed-by: Gusted <postmaster@gusted.xyz>
41 lines
1.6 KiB
Go HTML Template
41 lines
1.6 KiB
Go HTML Template
<div class="ui small modal" id="push-mirror-edit-modal">
|
|
<div class="header">
|
|
{{ctx.Locale.Tr "repo.settings.mirror_settings.push_mirror.edit_sync_time"}}
|
|
</div>
|
|
<div class="content">
|
|
<form class="ui form ignore-dirty" method="post">
|
|
<input type="hidden" name="action" value="push-mirror-update">
|
|
<input type="hidden" name="push_mirror_id" id="push-mirror-edit-id">
|
|
<div class="field">
|
|
<label for="name">{{ctx.Locale.Tr "repo.settings.mirror_settings.mirrored_repository"}}</label>
|
|
<div class="ui small input">
|
|
<input id="push-mirror-edit-address" readonly>
|
|
</div>
|
|
</div>
|
|
<div class="inline field">
|
|
<label for="push-mirror-edit-interval">{{ctx.Locale.Tr "repo.mirror_interval" .MinimumMirrorInterval}}</label>
|
|
<div class="ui small input">
|
|
<input id="push-mirror-edit-interval" name="push_mirror_interval" autofocus>
|
|
</div>
|
|
</div>
|
|
<div class="field">
|
|
<label for="push-mirror-edit-branch-filter">{{ctx.Locale.Tr "repo.settings.push_mirror.branch_filter.label"}}</label>
|
|
<div class="ui small input">
|
|
<input id="push-mirror-edit-branch-filter" name="push_mirror_branch_filter" maxlength="2048">
|
|
</div>
|
|
<p class="help">{{ctx.Locale.Tr "repo.settings.push_mirror.branch_filter.description" "https://forgejo.org/docs/latest/user/repo-mirror/#branch-filter" "Forgejo"}}</p>
|
|
</div>
|
|
<div class="actions">
|
|
<button class="ui small basic cancel button">
|
|
{{svg "octicon-x"}}
|
|
{{ctx.Locale.Tr "cancel"}}
|
|
</button>
|
|
<button class="ui primary small approve button">
|
|
{{svg "fontawesome-save"}}
|
|
{{ctx.Locale.Tr "save"}}
|
|
</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|