From 02cd6476495b775e94c953e2d7230841ea6d6c9e Mon Sep 17 00:00:00 2001 From: Fredrik Thorsson Date: Tue, 13 Aug 2024 11:24:06 +0200 Subject: [PATCH] feat: make map key and signature optional --- components/Maps/StaticMap/index.tsx | 2 +- env/server.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/components/Maps/StaticMap/index.tsx b/components/Maps/StaticMap/index.tsx index 833717833..c8bf60a26 100644 --- a/components/Maps/StaticMap/index.tsx +++ b/components/Maps/StaticMap/index.tsx @@ -30,7 +30,7 @@ export default function StaticMap({ }: StaticMapProps) { const key = env.GOOGLE_STATIC_MAP_KEY const secret = env.GOOGLE_STATIC_MAP_SIGNATURE_SECRET - const safeSecret = decodeBase64Hash(removeWebSafe(secret)) + const safeSecret = decodeBase64Hash(removeWebSafe(secret ?? "")) const url = new URL( `https://maps.googleapis.com/maps/api/staticmap?center=${city}&zoom=${zoomLevel}&size=${width}x${height}&maptype=${mapType}&key=${key}` diff --git a/env/server.ts b/env/server.ts index 866429659..d4f5f84c2 100644 --- a/env/server.ts +++ b/env/server.ts @@ -58,8 +58,8 @@ export const env = createEnv({ SEAMLESS_LOGOUT_SV: z.string(), WEBVIEW_ENCRYPTION_KEY: z.string(), BOOKING_ENCRYPTION_KEY: z.string(), - GOOGLE_STATIC_MAP_KEY: z.string(), - GOOGLE_STATIC_MAP_SIGNATURE_SECRET: z.string(), + GOOGLE_STATIC_MAP_KEY: z.string().optional(), + GOOGLE_STATIC_MAP_SIGNATURE_SECRET: z.string().optional(), }, emptyStringAsUndefined: true, runtimeEnv: {