Skip to content

Commit

Permalink
temp: /tool/auth
Browse files Browse the repository at this point in the history
  • Loading branch information
giannis2two committed Jul 11, 2024
1 parent e0cf5ff commit 81eeb01
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/backend/tools/google_drive/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 81eeb01

Please sign in to comment.