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

Errors solved

parent 0a5da1e0
...@@ -90,22 +90,24 @@ ...@@ -90,22 +90,24 @@
</style> </style>
<script> <script>
const user = require("../model/user.js")
export default { export default {
name: 'Inscription', name: 'Inscription',
components: { components: {
LoginNavbar LoginNavbar
}, },
data(){ // the data, declared as function data(){ // the data, declared as function
return{ // we return all the properties that should be react on. return{ // we return all the properties that should be react on.
firstname:"", firstname:"",
lastname:"", lastname:"",
login:"", login:"",
email:"", email:"",
password:"", password:"",
confirmpassword:"" confirmpassword:""
} }
}, },
methods: { methods: {
check: function(){ check: function(){
let firstname = this.firstname let firstname = this.firstname
let lastname = this.lastname let lastname = this.lastname
...@@ -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