Add missing CSRF tokens

This commit is contained in:
2025-11-21 23:16:45 +08:00
parent 5350d04ba5
commit 840fd176d3
4 changed files with 49 additions and 4 deletions

View File

@@ -409,6 +409,7 @@
</div>
<form method="POST" action="{{ url_for('ui.update_bucket_replication', bucket_name=bucket_name) }}" onsubmit="return confirm('Are you sure you want to disable replication?');">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
<input type="hidden" name="action" value="delete">
<button type="submit" class="btn btn-danger">Disable Replication</button>
</form>
@@ -418,6 +419,7 @@
{% if connections %}
<form method="POST" action="{{ url_for('ui.update_bucket_replication', bucket_name=bucket_name) }}">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
<input type="hidden" name="action" value="create">
<div class="mb-3">
@@ -434,7 +436,12 @@
<div class="mb-3">
<label for="target_bucket" class="form-label">Target Bucket Name</label>
<input type="text" class="form-control" id="target_bucket" name="target_bucket" required placeholder="e.g. my-backup-bucket">
<div class="form-text">The bucket on the remote service must already exist.</div>
<div class="form-check mt-2">
<input class="form-check-input" type="checkbox" id="create_remote_bucket" name="create_remote_bucket">
<label class="form-check-label" for="create_remote_bucket">
Create this bucket on the remote server if it doesn't exist
</label>
</div>
</div>
<button type="submit" class="btn btn-primary">Enable Replication</button>