csrf implemented

This commit is contained in:
Priec
2026-06-21 17:40:21 +02:00
parent 5b203ed248
commit 86888b3877
7 changed files with 359 additions and 0 deletions

View File

@@ -68,6 +68,12 @@ impl Hooks for App {
.layer(axum::middleware::from_fn_with_state(
ctx.clone(),
crate::shared::rbac::inject_subject,
))
// CSRF runs outermost so it validates the double-submit token before
// any handler sees the request and stamps the cookie on safe ones.
.layer(axum::middleware::from_fn_with_state(
ctx.clone(),
crate::shared::csrf::protect,
)))
}