Commit 97c6d41d authored by thibaut-felten's avatar thibaut-felten

Errors solved

parent 0a5da1e0
...@@ -90,6 +90,8 @@ ...@@ -90,6 +90,8 @@
</style> </style>
<script> <script>
const user = require("../model/user.js")
export default { export default {
name: 'Inscription', name: 'Inscription',
components: { components: {
...@@ -146,7 +148,11 @@ export default { ...@@ -146,7 +148,11 @@ export default {
fetch(url, params) fetch(url, params)
.then(response=>response.json()) .then(response=>response.json())
.then(data=>console.log(data)) .then(response=> {
user.token = response.jwt_token
user.id = response.id
})
.then(this.$router.push('/'))
} }
...@@ -154,5 +160,7 @@ export default { ...@@ -154,5 +160,7 @@ export default {
} }
import LoginNavbar from '../components/LoginNavbar.vue' import LoginNavbar from '../components/LoginNavbar.vue'
</script> </script>
...@@ -114,10 +114,8 @@ export default { ...@@ -114,10 +114,8 @@ export default {
fetch(url, params) fetch(url, params)
.then(response=>response.json()) .then(response=>response.json())
.then(response => { .then(response => {
console.log(response)
user.token = response.jwt_token user.token = response.jwt_token
user.id = response.data.id user.id = response.data.id
console.log(user)
}) })
.then(this.$router.push("/")) .then(this.$router.push("/"))
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment