Skip to content

Commit

Permalink
fix: enforce https callback url
Browse files Browse the repository at this point in the history
  • Loading branch information
nrjadkry committed Jul 24, 2024
1 parent 628f5cd commit 79d3347
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/backend/app/users/oauth_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ async def login_url(google_auth=Depends(init_google_auth)):
async def callback(request: Request, google_auth=Depends(init_google_auth)):
"""Performs token exchange between Google and DTM API"""

callback_url = str(request.url)
# Enforce https callback url
callback_url = str(request.url).replace("http://", "https://")

access_token = google_auth.callback(callback_url).get("access_token")

user_data = google_auth.deserialize_access_token(access_token)
Expand Down

0 comments on commit 79d3347

Please sign in to comment.