Skip to content
/ qp-n8n Public
forked from n8n-io/n8n

Commit

Permalink
fix(editor): Display correct error message for env access (n8n-io#5634)
Browse files Browse the repository at this point in the history
  • Loading branch information
janober authored and sunilrr committed Apr 24, 2023
1 parent 1835dd5 commit b447441
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions packages/workflow/src/WorkflowDataProxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -461,10 +461,14 @@ export class WorkflowDataProxy {
get(target, name, receiver) {
if (name === 'isProxy') return true;

if (
typeof process === 'undefined' || // env vars are inaccessible to frontend
process.env.N8N_BLOCK_ENV_ACCESS_IN_NODE === 'true'
) {
if (typeof process === 'undefined') {
throw new ExpressionError('not accessible via UI, please run node', {
runIndex: that.runIndex,
itemIndex: that.itemIndex,
failExecution: true,
});
}
if (process.env.N8N_BLOCK_ENV_ACCESS_IN_NODE === 'true') {
throw new ExpressionError('access to env vars denied', {
causeDetailed:
'If you need access please contact the administrator to remove the environment variable ‘N8N_BLOCK_ENV_ACCESS_IN_NODE‘',
Expand Down

0 comments on commit b447441

Please sign in to comment.