From 5fd25dd8d00d616803c2260b6881c35b394254e2 Mon Sep 17 00:00:00 2001 From: Doug Schrashun Date: Wed, 8 Jan 2025 10:13:12 -0500 Subject: [PATCH] fix some more errors, add tf env var for API JWT key --- frontend/.env.development | 2 +- frontend/src/components/user/UserControl.tsx | 2 +- frontend/src/services/auth/session.ts | 5 +++++ .../frontend/app-config/env-config/environment-variables.tf | 4 ++++ 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/frontend/.env.development b/frontend/.env.development index a9ec42c2e..abf31259f 100644 --- a/frontend/.env.development +++ b/frontend/.env.development @@ -32,4 +32,4 @@ USE_SEARCH_MOCK_DATA=false NEW_RELIC_APP_NAME= NEW_RELIC_LICENSE_KEY= -SESSION_SECRET=extraSecretSessionSecretValueSssh +# SESSION_SECRET=extraSecretSessionSecretValueSssh diff --git a/frontend/src/components/user/UserControl.tsx b/frontend/src/components/user/UserControl.tsx index 64e2847bc..e48c94336 100644 --- a/frontend/src/components/user/UserControl.tsx +++ b/frontend/src/components/user/UserControl.tsx @@ -20,7 +20,7 @@ const LoginLink = ({ loginUrl: string; }) => { return ( -
+
{ + if (!environment.SESSION_SECRET || !environment.API_JWT_PUBLIC_KEY) { + // eslint-disable-next-line + console.debug("Session keys not present"); + return; + } // eslint-disable-next-line console.debug("Initializing Session Secrets"); clientJwtKey = encodeText(environment.SESSION_SECRET); diff --git a/infra/frontend/app-config/env-config/environment-variables.tf b/infra/frontend/app-config/env-config/environment-variables.tf index 2551d89dc..857afce37 100644 --- a/infra/frontend/app-config/env-config/environment-variables.tf +++ b/infra/frontend/app-config/env-config/environment-variables.tf @@ -75,5 +75,9 @@ locals { manage_method = "manual" secret_store_name = "/${var.app_name}/${var.environment}/feature-auth-on" }, + API_JWT_PUBLIC_KEY = { + manage_method = "manual" + secret_store_name = "/api/${var.environment}/api-jwt-public-key" + }, } }