pub type IsAuthenticated = fn(_: &HttpRequest, _: &mut Payload) -> bool;
Expand description

Function to check if a request is authenticated

// implementation for actix::Identity based session management
fn is_authenticated(r: &HttpRequest, pl: &mut Payload) -> bool {
    matches!(
        Identity::from_request(r, pl)
            .into_inner()
            .map(|id| id.identity()),
        Ok(Some(_))
    )
}