summaryrefslogtreecommitdiff
path: root/store/auth.js
diff options
context:
space:
mode:
authorSanto Cariotti <santo@dcariotti.me>2022-09-14 19:11:34 +0200
committerSanto Cariotti <santo@dcariotti.me>2022-09-14 19:11:34 +0200
commitbeba244ea3c28aed4c7cf09b77377b55a5960daa (patch)
tree571c6a6a874a768b3d9c96c4689833d57fb96230 /store/auth.js
parent8aee0d826a38cc7c78660a8af70edbd85dbf3745 (diff)
Add signin page
Diffstat (limited to 'store/auth.js')
-rw-r--r--store/auth.js5
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");
}