Skip to content

Commit

Permalink
feat: use sessionStorage rather than localStorage
Browse files Browse the repository at this point in the history
  • Loading branch information
lbwa committed Oct 6, 2018
1 parent 767a1c3 commit 6326ccd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/auth/index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
const DEFAULT_TOKEN_KEY = '__vue-design-pro__'

export function setTokenToLocal ({ key = DEFAULT_TOKEN_KEY, token }) {
localStorage.setItem(key, token)
sessionStorage.setItem(key, token)
}

export function getTokenFromLocal (key = DEFAULT_TOKEN_KEY) {
localStorage.getItem(key)
sessionStorage.getItem(key)
}

export function removeToken (key = DEFAULT_TOKEN_KEY) {
localStorage.removeItem(key)
sessionStorage.removeItem(key)
}

0 comments on commit 6326ccd

Please sign in to comment.