mirror of
https://github.com/simstudioai/sim.git
synced 2026-04-28 03:00:29 -04:00
fix(bug): fix auth client in vercel & fix function block envvar resolution
This commit is contained in:
@@ -29,7 +29,8 @@ function resolveCodeVariables(
|
||||
const varName = match.slice(2, -2).trim()
|
||||
// Priority: 1. Environment variables from workflow, 2. Params, 3. process.env
|
||||
const varValue = envVars[varName] || params[varName] || process.env[varName] || ''
|
||||
resolvedCode = resolvedCode.replace(match, varValue)
|
||||
// Wrap the value in quotes to ensure it's treated as a string literal
|
||||
resolvedCode = resolvedCode.replace(match, JSON.stringify(varValue))
|
||||
}
|
||||
|
||||
// Resolve tags with <tag_name> syntax
|
||||
|
||||
@@ -5,16 +5,15 @@ export function getBaseURL() {
|
||||
let baseURL
|
||||
|
||||
if (process.env.VERCEL_ENV === 'preview') {
|
||||
baseURL = `https://${process.env.VERCEL_URL}`
|
||||
baseURL = `https://${process.env.NEXT_PUBLIC_VERCEL_URL}`
|
||||
} else if (process.env.VERCEL_ENV === 'development') {
|
||||
baseURL = `https://${process.env.VERCEL_URL}`
|
||||
baseURL = `https://${process.env.NEXT_PUBLIC_VERCEL_URL}`
|
||||
} else if (process.env.VERCEL_ENV === 'production') {
|
||||
baseURL = process.env.BETTER_AUTH_URL
|
||||
} else if (process.env.NODE_ENV === 'development') {
|
||||
baseURL = process.env.BETTER_AUTH_URL
|
||||
}
|
||||
|
||||
console.log('baseURL:', baseURL)
|
||||
return baseURL
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user