summaryrefslogblamecommitdiffstats
path: root/src/routes/logout.rs
blob: 712b74ca3ce6550091ae73b5186dffd467de87c5 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11










                                                 
use actix_session::Session;
use actix_web::http::header::LOCATION;
use actix_web::{post, HttpResponse};

#[post("/logout")]
async fn post(session: Session) -> HttpResponse {
    session.purge();
    HttpResponse::SeeOther()
        .insert_header((LOCATION, "/"))
        .finish()
}