From 7666cb6a5a09a6bd9e5d2191bd92405d5f5cbb54 Mon Sep 17 00:00:00 2001 From: Tahier Hussain Date: Fri, 24 Jan 2025 15:22:31 +0530 Subject: [PATCH] Clear the logs message on logout --- backend/account_v2/authentication_controller.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backend/account_v2/authentication_controller.py b/backend/account_v2/authentication_controller.py index 31dd284d7..2cd621424 100644 --- a/backend/account_v2/authentication_controller.py +++ b/backend/account_v2/authentication_controller.py @@ -38,6 +38,7 @@ from django.db.utils import IntegrityError from django.middleware import csrf from django.shortcuts import redirect +from logs_helper.log_service import LogService from rest_framework import status from rest_framework.request import Request from rest_framework.response import Response @@ -268,6 +269,8 @@ def make_user_organization_display_name(self, user_name: str) -> str: return self.auth_service.make_user_organization_display_name(user_name) def user_logout(self, request: Request) -> Response: + session_id: str = UserSessionUtils.get_session_id(request=request) + LogService.remove_logs_on_logout(session_id=session_id) response = self.auth_service.user_logout(request=request) organization_id = UserSessionUtils.get_organization_id(request) user_id = UserSessionUtils.get_user_id(request)