Skip to main content

guard

Function guard 

Source
pub fn guard(cx: &Cx) -> Result<()>
Expand description

Require a signed-in user when the request’s panel requires sign-in.

Every panel handler runs it first, and a page, route or shard the app serves under a panel runs it to answer exactly as the panel’s own pages do. Shards are the case that needs it: Topcoat serves them at its runtime path, where no page guard runs. A form route also verifies its CSRF token with csrf::verify.

§Errors

401, or a redirect to the login page, as require_user answers.