diff --git a/motorradig/.idea/workspace.xml b/motorradig/.idea/workspace.xml
index 69308dc..7078bd9 100644
--- a/motorradig/.idea/workspace.xml
+++ b/motorradig/.idea/workspace.xml
@@ -5,11 +5,8 @@
-
-
-
-
-
+
+
diff --git a/motorradig/public/js/app.js b/motorradig/public/js/app.js
index 07a416b..bf51983 100644
--- a/motorradig/public/js/app.js
+++ b/motorradig/public/js/app.js
@@ -2714,9 +2714,17 @@ __webpack_require__.r(__webpack_exports__);
password: this.password
};
console.log(formData);
- axios.post('http://localhost:8000/api/v1/auth/login', {
+ var api_url = this.$store.state.app_url + '/api/v1/auth/login';
+ console.log("Target URL:" + api_url);
+ axios.post(api_url, {
email: this.email,
password: this.password
+ }, {
+ // Trying to manage CORS
+ headers: {
+ 'Access-Control-Allow-Origin': '*',
+ 'Content-Type': 'application/json'
+ }
}).then(function (res) {
console.log("Login successful. Token=" + res.headers.authorization);
_this.$store.state.user_token = res.headers.authorization;
@@ -2730,7 +2738,8 @@ __webpack_require__.r(__webpack_exports__);
_this.$router.push('/');
})["catch"](function (error) {
- console.log("Login unsuccessful."); //console.log(error)
+ console.log("Login unsuccessful.");
+ console.log(error);
});
}
},
@@ -2835,7 +2844,7 @@ __webpack_require__.r(__webpack_exports__);
password_confirmation: this.password_confirmation
};
console.log(formData);
- axios.post('http://localhost:8000/api/v1/auth/register', {
+ axios.post(this.$store.state.app_url + '/api/v1/auth/register', {
name: this.name,
email: this.email,
password: this.password,
@@ -49220,8 +49229,8 @@ var store = new vuex__WEBPACK_IMPORTED_MODULE_1__["default"].Store({
userlist: {},
folders: {},
selectedFolder: "default",
- //app_url:"http://www.programmschmiede.de"
- app_url: "http://www.localhost:8000"
+ app_url: "http://www.programmschmiede.de" //app_url:"http://www.localhost:8000"
+
}
});
diff --git a/motorradig/resources/js/store.js b/motorradig/resources/js/store.js
index f53dc67..a554fb6 100644
--- a/motorradig/resources/js/store.js
+++ b/motorradig/resources/js/store.js
@@ -12,7 +12,7 @@ export const store = new Vuex.Store({
folders:{},
selectedFolder:"default",
- //app_url:"http://www.programmschmiede.de"
- app_url:"http://www.localhost:8000"
+ app_url:"http://www.programmschmiede.de"
+ //app_url:"http://www.localhost:8000"
}
});
diff --git a/motorradig/resources/js/views/auth/Login.vue b/motorradig/resources/js/views/auth/Login.vue
index 785f641..de5d22e 100644
--- a/motorradig/resources/js/views/auth/Login.vue
+++ b/motorradig/resources/js/views/auth/Login.vue
@@ -63,9 +63,19 @@
password: this.password,
}
console.log(formData)
- axios.post('http://localhost:8000/api/v1/auth/login', {
+
+ let api_url=this.$store.state.app_url +'/api/v1/auth/login';
+ console.log("Target URL:"+api_url);
+
+ axios.post(api_url, {
email: this.email,
password: this.password
+ }, {
+ // Trying to manage CORS
+ headers: {
+ 'Access-Control-Allow-Origin': '*',
+ 'Content-Type': 'application/json'
+ }
})
.then(res => {
console.log("Login successful. Token="+res.headers.authorization);
@@ -83,7 +93,7 @@
)
.catch(error => {
console.log("Login unsuccessful.");
- //console.log(error)
+ console.log(error)
})
}
}
diff --git a/motorradig/resources/js/views/auth/Register.vue b/motorradig/resources/js/views/auth/Register.vue
index 4398702..ed81493 100644
--- a/motorradig/resources/js/views/auth/Register.vue
+++ b/motorradig/resources/js/views/auth/Register.vue
@@ -74,7 +74,7 @@
password_confirmation: this.password_confirmation,
};
console.log(formData);
- axios.post('http://localhost:8000/api/v1/auth/register', {
+ axios.post(this.$store.state.app_url +'/api/v1/auth/register', {
name: this.name,
email: this.email,
password: this.password,