diff --git a/api/v1/endpoints/register.py b/api/v1/endpoints/register.py index 6f3041d..73510a2 100644 --- a/api/v1/endpoints/register.py +++ b/api/v1/endpoints/register.py @@ -23,7 +23,7 @@ responses={400: {"model": response.BadRequest}}, tags=["register"], ) -def create_propagated_user(user: models.User, request: Request): +async def create_propagated_user(user: models.User, request: Request): """ Create the requested client_ids with different APIs. @@ -90,11 +90,14 @@ def create_propagated_user(user: models.User, request: Request): logging.info(f"propagated to all apis result: {str(propagated)}") token = tokens.create_token(user_ids[0], secret) - resp = {"authorization": f"Bearer {token}", "propagated": propagated} + token_response = {"authorization": f"Bearer {token}", "propagated": propagated} + logging.info(f"found response {token_response}") if settings.ENV.lower() == "kubernetes": https_url = request.url.replace(scheme="https") headers = {"Location": str(https_url)} - return JSONResponse(status_code=200, content=resp, headers=headers) + logging.info(https_url) + logging.info(headers) + return JSONResponse(status_code=200, content=token_response, headers=headers) else: - return JSONResponse(status_code=200, content=resp) + return JSONResponse(status_code=200, content=token_response) diff --git a/api/v1/endpoints/tokens.py b/api/v1/endpoints/tokens.py index 431bb3e..73ca0b4 100644 --- a/api/v1/endpoints/tokens.py +++ b/api/v1/endpoints/tokens.py @@ -3,6 +3,7 @@ from models import response from models import token as models from util import tokens +from fastapi.responses import JSONResponse from config.settings import settings