From e6e2be78d71d45d556962373a59de3cad9fcec17 Mon Sep 17 00:00:00 2001 From: Devin Cowan Date: Tue, 21 Nov 2023 13:41:08 -0500 Subject: [PATCH 1/3] rm social icons --- app/frontend/src/components/TheFooter.vue | 7 ------- 1 file changed, 7 deletions(-) diff --git a/app/frontend/src/components/TheFooter.vue b/app/frontend/src/components/TheFooter.vue index 6e79ab1d..821a701c 100644 --- a/app/frontend/src/components/TheFooter.vue +++ b/app/frontend/src/components/TheFooter.vue @@ -2,7 +2,6 @@
-
{{ new Date().getFullYear() }} — Subsetter
@@ -16,12 +15,6 @@ \ No newline at end of file From 4cc3e86d6053469af6e6f9ed62f6b9b07d27258c Mon Sep 17 00:00:00 2001 From: Devin Cowan Date: Tue, 21 Nov 2023 14:05:55 -0500 Subject: [PATCH 2/3] Revert "hard code redirect uri" This reverts commit 754181fab9debeac14ec81380d6fe8818ee93ba2. --- app/frontend/src/auth.js | 4 ++-- app/frontend/src/constants.js | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/frontend/src/auth.js b/app/frontend/src/auth.js index b2ed5a79..f7a532dd 100644 --- a/app/frontend/src/auth.js +++ b/app/frontend/src/auth.js @@ -1,4 +1,4 @@ -import { ENDPOINTS, APP_URL } from '@/constants' +import { ENDPOINTS, APP_URL, OAUTH2_REDIRECT_URL } from '@/constants' import { useAuthStore } from '@/stores/auth' // import { fetchWrapper } from '@/_helpers/fetch-wrapper'; // function openLogInDialog(redirectTo) { @@ -11,7 +11,7 @@ export async function logIn(callback) { // alter redirect uri const authUrl = new URL(json.authorization_url) - authUrl.searchParams.set('redirect_uri', `${APP_URL}/#/auth-redirect`) + authUrl.searchParams.set('redirect_uri', OAUTH2_REDIRECT_URL) window.open( authUrl.toString(), '_blank', diff --git a/app/frontend/src/constants.js b/app/frontend/src/constants.js index 21a58df3..985c451c 100644 --- a/app/frontend/src/constants.js +++ b/app/frontend/src/constants.js @@ -1,6 +1,7 @@ export const APP_NAME = import.meta.env.VITE_APP_NAME || ""; export const APP_URL = import.meta.env.VITE_APP_URL || ""; export const APP_BASE = import.meta.env.VITE_APP_BASE || ""; +export const OAUTH2_REDIRECT_URL = import.meta.env.VITE_OAUTH2_REDIRECT_URL || ""; export const API_BASE = import.meta.env.VITE_APP_API_URL || ""; export const ENDPOINTS = { From 24054943da46326ec5398f2e8f4eb62ef585402c Mon Sep 17 00:00:00 2001 From: Devin Cowan Date: Tue, 21 Nov 2023 14:13:11 -0500 Subject: [PATCH 3/3] use pydantic get_settings for env expansion --- app/api/subsetter/config/__init__.py | 1 + app/api/subsetter/main.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/api/subsetter/config/__init__.py b/app/api/subsetter/config/__init__.py index a64b5826..13b1e558 100644 --- a/app/api/subsetter/config/__init__.py +++ b/app/api/subsetter/config/__init__.py @@ -20,6 +20,7 @@ class Settings(BaseSettings): oauth2_client_secret: str oauth2_redirect_url: str vite_oauth2_redirect_url: str + allow_origins: str minio_access_key: str minio_secret_key: str diff --git a/app/api/subsetter/main.py b/app/api/subsetter/main.py index e9d2b478..de7e2349 100644 --- a/app/api/subsetter/main.py +++ b/app/api/subsetter/main.py @@ -25,9 +25,9 @@ "swagger_ui_client_id": cuahsi_oauth_client.client_id, } -app = FastAPI(servers=[{"url": os.path.expandvars(os.environ['VITE_APP_API_URL'])}], swagger_ui_parameters=swagger_params) +app = FastAPI(servers=[{"url": get_settings().vite_oauth2_redirect_url}], swagger_ui_parameters=swagger_params) -origins = [os.path.expandvars(os.environ['ALLOW_ORIGINS'])] +origins = [get_settings().allow_origins] app.add_middleware( CORSMiddleware,