feat: make map key and signature optional
This commit is contained in:
@@ -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}`
|
||||
|
||||
4
env/server.ts
vendored
4
env/server.ts
vendored
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user