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

Update Profile.vue

parent edbc0db7
...@@ -25,14 +25,15 @@ Vue.mixin({ ...@@ -25,14 +25,15 @@ Vue.mixin({
isExpired() { isExpired() {
fetch(this.$apiUrl + '/validatetoken', { fetch(this.$apiUrl + '/validatetoken', {
method: 'GET', method: 'GET',
header: { headers: {
'Authorization' : 'Bearer ' + localStorage.token 'Authorization' : 'Bearer ' + localStorage.token
} }
}) })
.then(response => { .then(response => {
if (response.status === 200) { if (response.status === 200) {
return false return false
} else { }
else {
window.location.href = '/#/' window.location.href = '/#/'
} }
}) })
......
...@@ -19,6 +19,30 @@ ...@@ -19,6 +19,30 @@
name: 'GameChoice', name: 'GameChoice',
components: { components: {
Navbar 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> </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