From 73a862c7ecefcd7ab77678dd69f99eff0ee95504 Mon Sep 17 00:00:00 2001 From: Jamie Hewitt Date: Wed, 19 May 2021 11:54:28 +0300 Subject: [PATCH] importing RBAC url from config file --- app.config.js | 4 ++-- src/utils/rbac.ts | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app.config.js b/app.config.js index 5e63f0d74..eee2ea523 100644 --- a/app.config.js +++ b/app.config.js @@ -4,6 +4,7 @@ module.exports = { // networks in their wallet. // Ocean Protocol contracts are deployed for: 'mainnet', 'rinkeby', 'development' network: process.env.GATSBY_NETWORK || 'mainnet', + rbacUrl: process.env.RBAC_URL || 'false', infuraProjectId: process.env.GATSBY_INFURA_PROJECT_ID || 'xxx', @@ -43,6 +44,5 @@ module.exports = { // Used to show or hide the fixed and dynamic price options // tab to publishers during the price creation. allowFixedPricing: process.env.GATSBY_ALLOW_FIXED_PRICING || 'true', - allowDynamicPricing: process.env.GATSBY_ALLOW_DYNAMIC_PRICING || 'true', - rbacUrl: process.env.RBAC_URL + allowDynamicPricing: process.env.GATSBY_ALLOW_DYNAMIC_PRICING || 'true' } diff --git a/src/utils/rbac.ts b/src/utils/rbac.ts index 6c5f69890..af02b9c20 100644 --- a/src/utils/rbac.ts +++ b/src/utils/rbac.ts @@ -1,4 +1,5 @@ import fetch from 'cross-fetch' +import { rbacUrl, network } from '../../app.config' export async function rbacRequest( component: string, @@ -12,7 +13,8 @@ export async function rbacRequest( token } } - console.log('process.env.RBAC_URL', process.env.RBAC_URL) + console.log('rbacUrl', rbacUrl) + console.log('network', network) try { const response = await fetch('http://localhost:3000', { method: 'POST',