Commit 5e412f5f authored by raphael.peim's avatar raphael.peim

Update Profile.vue

parent edbc0db7
......@@ -25,14 +25,15 @@ Vue.mixin({
isExpired() {
fetch(this.$apiUrl + '/validatetoken', {
method: 'GET',
header: {
headers: {
'Authorization' : 'Bearer ' + localStorage.token
}
})
.then(response => {
if (response.status === 200) {
return false
} else {
}
else {
window.location.href = '/#/'
}
})
......
......@@ -5,7 +5,7 @@
<div class="card shadow mb-4">
<h5 class="card-header text-primary">Vos informations</h5>
<div class="card-body" style="width : 500px;">
</div>
</div>
</div>
......@@ -19,6 +19,30 @@
name: 'GameChoice',
components: {
Navbar
},
beforeMount() {
this.getData()
},
methods: {
getData() {
fetch(this.$apiUrl + '/validatetoken', {
method: 'GET',
headers: {
'Authorization' : 'Bearer ' + localStorage.token
}
})
.then(response => {
if (response.status === 200) {
console.log(response.json())
}
// else {
// window.location.href = '/#/'
// }
})
// .then(tokenData => {
// console.log(tokenData)
// })
}
}
}
</script>
\ No newline at end of file
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