Skip to content

Commit

Permalink
fix hardcoded localhost to use .env
Browse files Browse the repository at this point in the history
  • Loading branch information
robertbinning committed Oct 15, 2024
1 parent 09a4140 commit 6c91c1d
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions backend/managers/AuthManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,12 @@ async def registration_options(self, email_id: str):

return challenge, options_to_json(options)

async def registrationResponse(self, challenge: str, email_id: str,user_id: str, response):
async def registrationResponse(self, challenge: str, email_id: str, user_id: str, response):
async with db_session_context() as session:
expected_origin = "https://localhost:8443"
expected_rpid = "localhost"
host = get_env_key('PAIOS_HOST', 'localhost')
port = get_env_key('PAIOS_PORT', '8443')
expected_origin = f"https://{host}:{port}"
expected_rpid = host

res = verify_registration_response(credential=response,
expected_challenge=base64url_to_bytes(challenge),
Expand Down Expand Up @@ -196,10 +198,13 @@ async def signinRequestOptions(self, email_id: str):
challenge = base64.urlsafe_b64encode(options.challenge).decode("utf-8").rstrip("=")
return challenge, options_to_json(options)

async def signinResponse(self, challenge: str,email_id:str, response):
async def signinResponse(self, challenge: str, email_id:str, response):
async with db_session_context() as session:
expected_origin = "https://localhost:8443"
expected_rpid = "localhost"
host = get_env_key('PAIOS_HOST', 'localhost')
port = get_env_key('PAIOS_PORT', '8443')
expected_origin = f"https://{host}:{port}"
expected_rpid = host

credential_result = await session.execute(select(Cred).where(Cred.id == response["id"]))
credential = credential_result.scalar_one_or_none()

Expand Down

0 comments on commit 6c91c1d

Please sign in to comment.