Skip to content

Commit

Permalink
Merge pull request #823 from hotosm/fixes
Browse files Browse the repository at this point in the history
fix: callback url
  • Loading branch information
nrjadkry authored Sep 11, 2023
2 parents 198bfe5 + 98b8d6d commit 8c6c487
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/backend/app/auth/auth_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
from fastapi import APIRouter, Depends, HTTPException, Request
from fastapi.responses import JSONResponse
from sqlalchemy.orm import Session
from ..config import settings


from ..db import database
from ..db.db_models import DbUser
Expand Down Expand Up @@ -66,7 +68,8 @@ def callback(request: Request, osm_auth=Depends(init_osm_auth)):
- access_token (string)
"""
print("Call back api requested", request.url)
access_token = osm_auth.callback(str(request.url))

access_token = osm_auth.callback(str(request.url).replace('http',settings.URL_SCHEME))
log.debug(f"Access token returned: {access_token}")
return JSONResponse(content={"access_token": access_token}, status_code=200)

Expand Down
2 changes: 1 addition & 1 deletion src/backend/app/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class Settings(BaseSettings):
DEBUG: bool = False
LOG_LEVEL: str = "DEBUG"

URL_SCHEME: Optional[str] = "https"
URL_SCHEME: Optional[str] = "http"
FRONTEND_MAIN_URL: Optional[str]
FRONTEND_MAP_URL: Optional[str]

Expand Down

0 comments on commit 8c6c487

Please sign in to comment.