Update config to take comma separated list of allowed URLs
This commit is contained in:
+1
-1
@@ -5,4 +5,4 @@ REACT_APP_DEFAULT_GAS_PRICE=0.025
|
||||
REACT_APP_GAS_ADJUSTMENT=2
|
||||
REACT_APP_LACONICD_RPC_URL=https://laconicd-sapo.laconic.com
|
||||
|
||||
REACT_APP_DEPLOY_APP_URL=
|
||||
REACT_APP_ALLOWED_URLS=
|
||||
|
||||
@@ -16,7 +16,9 @@ export const AutoSignIn = () => {
|
||||
const handleSignIn = async (event: MessageEvent) => {
|
||||
if (event.data.type !== 'AUTO_SIGN_IN') return;
|
||||
|
||||
if (event.origin !== process.env.REACT_APP_DEPLOY_APP_URL) {
|
||||
const allowedUrls = process.env.REACT_APP_ALLOWED_URLS?.split(',').map(url => url.trim());
|
||||
|
||||
if (!allowedUrls?.includes(event.origin)) {
|
||||
console.log('Unauthorized app.');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ REACT_APP_WALLET_CONNECT_PROJECT_ID=$WALLET_CONNECT_ID \
|
||||
REACT_APP_DEFAULT_GAS_PRICE=$CERC_DEFAULT_GAS_PRICE \
|
||||
REACT_APP_GAS_ADJUSTMENT=$CERC_GAS_ADJUSTMENT \
|
||||
REACT_APP_LACONICD_RPC_URL=$CERC_LACONICD_RPC_URL \
|
||||
REACT_APP_DEPLOY_APP_URL=$CERC_DEPLOY_APP_URL \
|
||||
REACT_APP_ALLOWED_URLS=$CERC_ALLOWED_URLS \
|
||||
yarn build
|
||||
|
||||
# Define the directory and file path
|
||||
|
||||
Reference in New Issue
Block a user