Skip to content

Commit

Permalink
frontend: local storage
Browse files Browse the repository at this point in the history
access and refresh token kept
  • Loading branch information
rkshaon committed Aug 13, 2024
1 parent c4cf312 commit ffcbe7d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions frontend/src/store/modules/user.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
// src/store/modules/auth.js

// import Vue from 'vue';
// import Vuex from 'vuex';

import { login } from "@/services/userAPIService";

const state = {
Expand All @@ -14,10 +11,14 @@ const mutations = {
setTokens(state, { accessToken, refreshToken }) {
state.accessToken = accessToken;
state.refreshToken = refreshToken;
localStorage.setItem("accessToken", accessToken);
localStorage.setItem("refreshToken", refreshToken);
},
clearTokens(state) {
state.accessToken = null;
state.refreshToken = null;
localStorage.removeItem("accessToken");
localStorage.removeItem("refreshToken");
},
};

Expand Down

0 comments on commit ffcbe7d

Please sign in to comment.