This repository has been archived on 2025-09-28. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
nekrochan/src/web/logout.rs
sneedmaster a2d093954d Nekrocuck
2025-09-28 12:59:09 +02:00

14 lines
355 B
Rust

use actix_web::{cookie::Cookie, get, http::StatusCode, HttpResponse, HttpResponseBuilder};
#[get("/logout")]
pub async fn logout() -> HttpResponse {
let mut auth = Cookie::named("auth");
auth.make_removal();
HttpResponseBuilder::new(StatusCode::SEE_OTHER)
.append_header(("Location", "/"))
.cookie(auth)
.finish()
}