use actix_identity::Identity; use actix_web::{http::header::LOCATION, HttpResponse, Responder}; #[actix_web::get("/logout")] pub async fn get(user: Identity) -> impl Responder { user.logout(); HttpResponse::Found().insert_header((LOCATION, "/")).finish() }