From 034a6bc4cceee3f754a782bf2a651ba65613a574 Mon Sep 17 00:00:00 2001 From: Liam Cabra Teixeira Date: Thu, 1 Oct 2020 20:10:56 -0300 Subject: [PATCH] fix login --- src/store/modules/ProfileVuex.js | 2 +- src/views/public/Login.vue | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/store/modules/ProfileVuex.js b/src/store/modules/ProfileVuex.js index de6f9f2..fb40818 100644 --- a/src/store/modules/ProfileVuex.js +++ b/src/store/modules/ProfileVuex.js @@ -22,7 +22,7 @@ export default { async getUser(context){ const token = localStorage.getItem('token'); const decodedToken = await axios.post(process.env.VUE_APP_BASE_URL+'/user/authToken', token); - + console.log(decodedToken) const user = await axios.get(process.env.VUE_APP_BASE_URL+`/user/mail/${decodedToken.data}`); return user.data; diff --git a/src/views/public/Login.vue b/src/views/public/Login.vue index c3359c2..5dbdc6a 100644 --- a/src/views/public/Login.vue +++ b/src/views/public/Login.vue @@ -71,7 +71,11 @@ export default { position: "topCenter" }) - localStorage.token = isAuth.data + // localStorage.token = isAuth.data[0] + + const token = isAuth.data[0]; + + localStorage.token = isAuth.data[0]; this.$router.push('/Feed') }