brass/web/src/endpoints/user/get_logout.rs

11 lines
268 B
Rust

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()
}