Skip to content

Commit fb25b14

Browse files
committed
fixed minor bug
1 parent 9b1348a commit fb25b14

File tree

1 file changed

+17
-18
lines changed

1 file changed

+17
-18
lines changed

src/views/Apps.vue

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -936,7 +936,7 @@
936936
import HfPopUp from "../components/element/hfPopup.vue";
937937
import StudioSideBar from "../components/element/StudioSideBar.vue";
938938
import UtilsMixin from "../mixins/utils";
939-
import { isEmpty, isValidOrigin } from "../mixins/fieldValidation";
939+
import { isEmpty } from "../mixins/fieldValidation";
940940
import "vue-loading-overlay/dist/vue-loading.css";
941941
import Loading from "vue-loading-overlay";
942942
import HfButtons from "../components/element/HfButtons.vue";
@@ -1055,7 +1055,7 @@ export default {
10551055
walletAddress: "",
10561056
edvId: "",
10571057
description: "",
1058-
whitelistedCors: "",
1058+
whitelistedCors: "*",
10591059
logoUrl: "",
10601060
tenantUrl: "",
10611061
services: [],
@@ -1298,18 +1298,17 @@ export default {
12981298
}
12991299
}
13001300
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+
// }
13131312
13141313
if (!this.appModel.domain) {
13151314
m.push(messages.APPLICATION.ENTER_DOMAIN_ORGIN);
@@ -1340,6 +1339,9 @@ export default {
13401339
},
13411340
async createAnApp() {
13421341
try {
1342+
if(!this.appModel.whitelistCors) {
1343+
this.appModel.whitelistedCors = '*';
1344+
}
13431345
const errorMessages = this.validateFields();
13441346
if (errorMessages && errorMessages.message.length > 0) {
13451347
throw errorMessages;
@@ -1348,10 +1350,7 @@ export default {
13481350
this.isLoading = true;
13491351
let whitelistCors = [];
13501352
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());
13551354
const cors = config?.studioServer?.WHITELIST_CORS?.split(",");
13561355
13571356
cors.forEach((e) => {

0 commit comments

Comments
 (0)