Skip to content

Commit

Permalink
add additional logging for secret handling
Browse files Browse the repository at this point in the history
  • Loading branch information
gvkhna committed May 31, 2024
1 parent cb33516 commit e1eacbb
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions src/secrets.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
// Astro doesn't reflect cloudflare env secrets correctly

import {Context} from 'hono'

export function getSecretAstro(key: string, locals: App.Locals) {
console.log('import env', import.meta.env)
console.log('astro env', locals.runtime.env)
if (import.meta && import.meta.env && import.meta.env[key]) {
return import.meta.env[key]
} else if (locals && locals.runtime && locals.runtime.env && locals.runtime.env[key]) {
Expand All @@ -15,9 +12,6 @@ export function getSecretAstro(key: string, locals: App.Locals) {
}

export function getSecretPlatform(key: string, ctx: Context) {
const importMetaEnv = import.meta.env
const contextEnv = ctx.env

if (import.meta && import.meta.env && import.meta.env[key]) {
return import.meta.env[key]
} else if (ctx && ctx.env[key]) {
Expand Down

0 comments on commit e1eacbb

Please sign in to comment.