From 81eeb01918454f04b431be3859606c0355e97d75 Mon Sep 17 00:00:00 2001 From: giannis Date: Thu, 11 Jul 2024 13:44:28 -0400 Subject: [PATCH] temp: /tool/auth --- src/backend/tools/google_drive/auth.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/backend/tools/google_drive/auth.py b/src/backend/tools/google_drive/auth.py index 88102cde61..5b139e2228 100644 --- a/src/backend/tools/google_drive/auth.py +++ b/src/backend/tools/google_drive/auth.py @@ -124,6 +124,17 @@ def process_auth_token(cls, request: Request, session: DBSessionDep) -> str: if res.status_code != 200: logger.error(f"Error in google drive auth: {res_body}") return res_body + + try: + tool_auth_crud.get_tool_auth( + db=session, tool_id=GoogleDrive.NAME, user_id=state["user_id"] + ) + tool_auth_crud.delete_tool_auth( + db=session, user_id=state["user_id"], tool_id=GoogleDrive.NAME + ) + except Exception as _e: + pass + tool_auth_crud.create_tool_auth( session, ToolAuth(