Type Definition actix_auth_middleware::IsAuthenticated
source · [−]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(_))
)
}