Skip to main content

verify_csrf

Function verify_csrf 

Source
pub fn verify_csrf(
    actix_admin: &ActixAdmin,
    session: &Session,
    req: &HttpRequest,
) -> Result<(), ActixAdminError>
Expand description

Assert that req carries a valid CSRF token for session. Returns Ok(()) when CSRF protection is disabled globally.

The token can be provided either via the X-CSRF-Token header (HTMX) or the _csrf query-string parameter (classic forms & multipart).