Skip to content

Commit

Permalink
fix: ucan log connect only when url and token
Browse files Browse the repository at this point in the history
  • Loading branch information
vasco-santos committed Mar 23, 2023
1 parent 754bf52 commit dc45e48
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions packages/access-api/src/utils/context.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,13 @@ export function getContext(request, env, ctx) {
sender: config.POSTMARK_SENDER,
})

const ucanLog = config.UCAN_LOG_URL
? UCANLog.connect({
url: new URL(config.UCAN_LOG_URL),
auth: config.UCAN_LOG_BASIC_AUTH,
})
: UCANLog.debug()
const ucanLog =
config.UCAN_LOG_URL && config.UCAN_LOG_BASIC_AUTH
? UCANLog.connect({
url: new URL(config.UCAN_LOG_URL),
auth: config.UCAN_LOG_BASIC_AUTH,
})
: UCANLog.debug()

// Sentry
const sentry = new Toucan({
Expand Down

0 comments on commit dc45e48

Please sign in to comment.