diff options
author | Santo Cariotti <santo@dcariotti.me> | 2022-09-14 19:11:34 +0200 |
---|---|---|
committer | Santo Cariotti <santo@dcariotti.me> | 2022-09-14 19:11:34 +0200 |
commit | beba244ea3c28aed4c7cf09b77377b55a5960daa (patch) | |
tree | 571c6a6a874a768b3d9c96c4689833d57fb96230 /store/auth.js | |
parent | 8aee0d826a38cc7c78660a8af70edbd85dbf3745 (diff) |
Add signin page
Diffstat (limited to 'store/auth.js')
-rw-r--r-- | store/auth.js | 5 |
1 files changed, 2 insertions, 3 deletions
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"); } |