Skip to content

Commit

Permalink
Merge pull request #88 from hotosm/hotfix
Browse files Browse the repository at this point in the history
hotfix: enforce https callback url
  • Loading branch information
nrjadkry authored Jul 24, 2024
2 parents 628f5cd + 79d3347 commit 58fc753
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 58fc753

Please sign in to comment.