Skip to content

Commit

Permalink
fixing google oauth issues
Browse files Browse the repository at this point in the history
  • Loading branch information
TransformerOptimus committed Jul 21, 2023
1 parent 9c89991 commit 7fd8d8d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions superagi/controllers/google_oauth.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from datetime import datetime, timedelta
from superagi.models.db import connect_db
import http.client as http_client
from superagi.helper.auth import get_current_user
from superagi.helper.auth import get_current_user, check_auth
from superagi.models.tool_config import ToolConfig
from superagi.models.toolkit import Toolkit
from superagi.models.oauth_tokens import OauthTokens
Expand Down Expand Up @@ -52,11 +52,11 @@ async def google_auth_calendar(code: str = Query(...), Authorize: AuthJWT = Depe
return RedirectResponse(url=redirect_url_success)

@router.post("/send_google_creds/toolkit_id/{toolkit_id}")
def send_google_calendar_configs(google_creds: dict, toolkit_id: int, Authorize: AuthJWT = Depends()):
def send_google_calendar_configs(google_creds: dict, toolkit_id: int, Authorize: AuthJWT = Depends(check_auth())):
engine = connect_db()
Session = sessionmaker(bind=engine)
session = Session()
current_user = get_current_user()
current_user = get_current_user(Authorize)
user_id = current_user.id
toolkit = db.session.query(Toolkit).filter(Toolkit.id == toolkit_id).first()
google_creds = json.dumps(google_creds)
Expand Down

0 comments on commit 7fd8d8d

Please sign in to comment.