Skip to main content

render_with_csrf

Function render_with_csrf 

Source
pub fn render_with_csrf(
    ctx: &ReqCtx,
    context: Context,
    template: &str,
) -> ApiResponse
Expand description

Render a page that contains a POST form, putting a CSRF token in scope as csrf_token and setting the cookie when a fresh one had to be minted. Every template rendered through this must echo the token into a hidden _csrf field, or its form will be rejected by crate::csrf::verify on submit.