From df53d2a0e89c28dc3da5518f9237b19b7a2ee982 Mon Sep 17 00:00:00 2001 From: Nutomic Date: Tue, 31 Oct 2023 13:41:52 +0100 Subject: [PATCH] Change logout endpoint to return SuccessResponse (#4121) --- crates/api/src/local_user/logout.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/api/src/local_user/logout.rs b/crates/api/src/local_user/logout.rs index a2cc83b3f..10b4732b7 100644 --- a/crates/api/src/local_user/logout.rs +++ b/crates/api/src/local_user/logout.rs @@ -1,7 +1,7 @@ use crate::read_auth_token; use activitypub_federation::config::Data; use actix_web::{cookie::Cookie, HttpRequest, HttpResponse}; -use lemmy_api_common::{context::LemmyContext, utils::AUTH_COOKIE_NAME}; +use lemmy_api_common::{context::LemmyContext, utils::AUTH_COOKIE_NAME, SuccessResponse}; use lemmy_db_schema::source::login_token::LoginToken; use lemmy_db_views::structs::LocalUserView; use lemmy_utils::error::{LemmyErrorType, LemmyResult}; @@ -16,7 +16,7 @@ pub async fn logout( let jwt = read_auth_token(&req)?.ok_or(LemmyErrorType::NotLoggedIn)?; LoginToken::invalidate(&mut context.pool(), &jwt).await?; - let mut res = HttpResponse::Ok().finish(); + let mut res = HttpResponse::Ok().json(SuccessResponse::default()); let cookie = Cookie::new(AUTH_COOKIE_NAME, ""); res.add_removal_cookie(&cookie)?; Ok(res)