Skip to content

Security enhancement for blog post deletion - #803

Merged
poppastring merged 2 commits into
mainfrom
edit-delete-fixes
Apr 13, 2026
Merged

poppastring merged 2 commits into
mainfrom
edit-delete-fixes

Conversation

@poppastring

Copy link
Copy Markdown
Owner

PR Classification

UI/UX improvement and security enhancement for blog post deletion.

PR Summary

This pull request replaces the JavaScript confirm dialog for deleting blog posts with a Bootstrap modal confirmation and updates the backend to use a secure POST request.

  • BlogPostController.cs: Changes delete action to POST with [ValidateAntiForgeryToken].
  • PostDeleteLinkTagHelper.cs: Updates delete link to trigger Bootstrap modal instead of JavaScript.
  • _DeleteConfirmationModalPartial.cshtml: Adds reusable modal partial for delete confirmation.
  • _BlogItem.cshtml: Integrates the delete confirmation modal partial.
  • site.js: Removes old JavaScript-based delete logic.

Switch blog post deletion from GET to POST and add anti-forgery token validation. Update controller, tag helper, view, and JavaScript to submit deletions securely via POST, preventing CSRF attacks.
Replaces JavaScript confirm with a Bootstrap modal for post deletion. Adds a reusable partial view for the confirmation dialog, includes anti-forgery token in the modal form, and removes the old deleteEntry JS function and inline anti-forgery token from the blog item view. Improves UI consistency and security.
@poppastring
poppastring merged commit 7f81962 into main Apr 13, 2026
3 checks passed
@poppastring
poppastring deleted the edit-delete-fixes branch April 13, 2026 04:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant