From a5eec18ab30f687a9326be704e8bb39f6e50ac4c Mon Sep 17 00:00:00 2001 From: gabatxo1312 Date: Mon, 1 Dec 2025 14:26:35 +0100 Subject: [PATCH] Fixing flash message cookie handling --- src/state/flash_message.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/state/flash_message.rs b/src/state/flash_message.rs index ad601a1..0694d23 100644 --- a/src/state/flash_message.rs +++ b/src/state/flash_message.rs @@ -1,5 +1,6 @@ use axum_extra::extract::{CookieJar, cookie::Cookie}; +#[derive(Debug)] pub struct OperationStatus { /// Status of operation pub success: bool, @@ -38,9 +39,14 @@ pub fn get_cookie(jar: CookieJar) -> (CookieJar, Option) { _ => None, }; + let mut operation_status_success_cookie = Cookie::from("operation_status_success"); + operation_status_success_cookie.set_path("/"); + let mut operation_status_message_cookie = Cookie::from("operation_status_message"); + operation_status_message_cookie.set_path("/"); + let jar = jar - .remove(Cookie::from("operation_status_success")) - .remove(Cookie::from("operation_status_message")); + .remove(operation_status_success_cookie) + .remove(operation_status_message_cookie); (jar, operation_status) }