mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-24 20:24:05 -08:00
fix(editor): Display correct error message for env access (#5634)
This commit is contained in:
parent
dc0e052c83
commit
5f238ea641
|
@ -461,10 +461,14 @@ export class WorkflowDataProxy {
|
||||||
get(target, name, receiver) {
|
get(target, name, receiver) {
|
||||||
if (name === 'isProxy') return true;
|
if (name === 'isProxy') return true;
|
||||||
|
|
||||||
if (
|
if (typeof process === 'undefined') {
|
||||||
typeof process === 'undefined' || // env vars are inaccessible to frontend
|
throw new ExpressionError('not accessible via UI, please run node', {
|
||||||
process.env.N8N_BLOCK_ENV_ACCESS_IN_NODE === 'true'
|
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', {
|
throw new ExpressionError('access to env vars denied', {
|
||||||
causeDetailed:
|
causeDetailed:
|
||||||
'If you need access please contact the administrator to remove the environment variable ‘N8N_BLOCK_ENV_ACCESS_IN_NODE‘',
|
'If you need access please contact the administrator to remove the environment variable ‘N8N_BLOCK_ENV_ACCESS_IN_NODE‘',
|
||||||
|
|
Loading…
Reference in a new issue