936
936
import HfPopUp from " ../components/element/hfPopup.vue" ;
937
937
import StudioSideBar from " ../components/element/StudioSideBar.vue" ;
938
938
import UtilsMixin from " ../mixins/utils" ;
939
- import { isEmpty , isValidOrigin } from " ../mixins/fieldValidation" ;
939
+ import { isEmpty } from " ../mixins/fieldValidation" ;
940
940
import " vue-loading-overlay/dist/vue-loading.css" ;
941
941
import Loading from " vue-loading-overlay" ;
942
942
import HfButtons from " ../components/element/HfButtons.vue" ;
@@ -1055,7 +1055,7 @@ export default {
1055
1055
walletAddress: " " ,
1056
1056
edvId: " " ,
1057
1057
description: " " ,
1058
- whitelistedCors: " " ,
1058
+ whitelistedCors: " * " ,
1059
1059
logoUrl: " " ,
1060
1060
tenantUrl: " " ,
1061
1061
services: [],
@@ -1298,18 +1298,17 @@ export default {
1298
1298
}
1299
1299
}
1300
1300
1301
- if (! Array .isArray (this .appModel .whitelistedCors )) {
1302
- const newArray = this .appModel .whitelistedCors
1303
- .split (" ," )
1304
- .filter ((x ) => x != " " )
1305
- .map ((x ) => x .trim ());
1306
- for (let i = 0 ; i < newArray .length ; i++ ) {
1307
- if (! isValidOrigin (newArray[i])) {
1308
- m .push (messages .APPLICATION .INVALID_CORS );
1309
- break ;
1310
- }
1311
- }
1312
- }
1301
+ // console.log('----------------------------------------------------------------')
1302
+ // console.log(this.appModel.whitelistedCors)
1303
+ // if (!Array.isArray(this.appModel.whitelistedCors)) {
1304
+ // const newArray = this.appModel.whitelistedCors?.split(",").filter((x) => x != " ").map((x) => x.trim());
1305
+ // for (let i = 0; i < newArray.length; i++) {
1306
+ // if (!isValidOrigin(newArray[i])) {
1307
+ // m.push(messages.APPLICATION.INVALID_CORS);
1308
+ // break;
1309
+ // }
1310
+ // }
1311
+ // }
1313
1312
1314
1313
if (! this .appModel .domain ) {
1315
1314
m .push (messages .APPLICATION .ENTER_DOMAIN_ORGIN );
@@ -1340,6 +1339,9 @@ export default {
1340
1339
},
1341
1340
async createAnApp () {
1342
1341
try {
1342
+ if (! this .appModel .whitelistCors ) {
1343
+ this .appModel .whitelistedCors = ' *' ;
1344
+ }
1343
1345
const errorMessages = this .validateFields ();
1344
1346
if (errorMessages && errorMessages .message .length > 0 ) {
1345
1347
throw errorMessages;
@@ -1348,10 +1350,7 @@ export default {
1348
1350
this .isLoading = true ;
1349
1351
let whitelistCors = [];
1350
1352
if (! isEmpty (this .appModel .whitelistedCors )) {
1351
- whitelistCors = this .appModel .whitelistedCors
1352
- .split (" ," )
1353
- .filter ((x ) => x != " " )
1354
- .map ((x ) => x .trim ());
1353
+ whitelistCors = this .appModel .whitelistedCors ? .split (" ," ).filter ((x ) => x != " " ).map ((x ) => x .trim ());
1355
1354
const cors = config? .studioServer ? .WHITELIST_CORS ? .split (" ," );
1356
1355
1357
1356
cors .forEach ((e ) => {
0 commit comments