From beba244ea3c28aed4c7cf09b77377b55a5960daa Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Wed, 14 Sep 2022 19:11:34 +0200 Subject: Add signin page --- store/auth.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'store') diff --git a/store/auth.js b/store/auth.js index 55126dc..dbf989f 100644 --- a/store/auth.js +++ b/store/auth.js @@ -17,7 +17,7 @@ export const getters = { export const mutations = { saveAccessToken: (state, value) => { - localStorage.setItem("access_token", key); + localStorage.setItem("access_token", value); state.token = value; }, // Remove access_token and credentials from the browser data @@ -48,8 +48,7 @@ export const actions = { res.data = await response.json(); res.status = response.status; if (res.status == 200) { - // This is usefull if the login is called by `keepAccess` - commit("saveUserInfo", res.data); + commit("saveAccessToken", res.data.access_token); } else { commit("logout"); } -- cgit v1.2.3-18-g5258