Skip to content

Commit

Permalink
Added Dungeongpt to the origins
Browse files Browse the repository at this point in the history
  • Loading branch information
autonomouscereal committed Jan 6, 2025
1 parent c71ad5c commit 9c0dcb6
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,17 @@ async def dispatch(self, request: Request, call_next):
"https://oauthconsole.cerealsoft.com",
"https://auth.cerealsoft.com",
"https://passbackend.cerealsoft.com",
"https://aiportals.cerealsoft.com",
"https://dungeongpt.cerealsoft.com",
"https://dungeongptbackend.cerealsoft.com",
# Add other production origins if needed
]
else:
origins = [
"https://localhost:8300", # ai portals back end
"http://localhost:8300", # ai portals back end
"https://localhost:3500", # ai portals front end
"http://localhost:3500", # ai portals front end
"https://localhost:3400", # oauth console front end
"https://localhost:3300", # Frontend origin
"https://localhost:3200",
Expand Down Expand Up @@ -122,16 +129,27 @@ async def startup():
if environment == 'production':
redirect_uri_password_vault = 'https://pass.cerealsoft.com/callback'
redirect_uri_oauth_console = 'https://oauthconsole.cerealsoft.com/callback'
redirect_uri_ai_portals = 'https://aiportals.cerealsoft.com/callback'
else:
redirect_uri_password_vault = 'https://localhost:3300/callback'
redirect_uri_oauth_console = 'https://localhost:3400/callback'
redirect_uri_ai_portals = 'https://localhost:3500/callback'

existing_client2 = await db_helper.get_client_by_id(client_id_password_vault)
logging.info(f"client 2: {existing_client2}")

existing_client3 = await db_helper.get_client_by_id(client_id_oauth_console)
logging.info(f"client 3: {existing_client3}")

# Register AI Portals frontend as a client
client_id_ai_portals = 'your_client_id'
client_secret_ai_portals = 'your_client_secret' # If applicable


existing_client4 = await db_helper.get_client_by_id(client_id_ai_portals)
if not existing_client4:
await db_helper.add_client(client_id_ai_portals, client_secret_ai_portals, [redirect_uri_ai_portals])

if not existing_client2:
await db_helper.add_client(client_id_password_vault, client_secret_password_vault, [redirect_uri_password_vault])

Expand Down

0 comments on commit 9c0dcb6

Please sign in to comment.