Skip to main content

require_user

Function require_user 

Source
pub fn require_user<U: PanelUser>(cx: &Cx) -> Result<&U>
Expand description

Require the signed-in user, as the app’s own user type.

§Errors

Answers per request kind (ADR-0013): pages redirect to the login route with a same-origin-relative next; runtime endpoints, non-GET requests, and page re-runs (marked POSTs the runtime layer rewrites into GETs) answer 401. A signed-in user of another type than U answers 403.