Skip to content

Commit

Permalink
minor update in auth template
Browse files Browse the repository at this point in the history
  • Loading branch information
Pooya Parsa committed Nov 15, 2017
1 parent 0e80ff5 commit 7362dc1
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/templates/auth.store.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ export default {
// Set Authorization token for all axios requests
this.$axios.setToken(token, '<%= options.token.type %>');

// Update localStorage
<% if (options.token.localStorage) { %>
if (process.browser && localStorage) {
if (token) {
localStorage.setItem('<%= options.token.name %>', token)
} else {
localStorage.removeItem('<%= options.token.name %>')
}
// Update localStorage
if (process.browser && localStorage) {
if (token) {
localStorage.setItem('<%= options.token.name %>', token)
} else {
localStorage.removeItem('<%= options.token.name %>')
}
}
<% } %>

<% if (options.token.cookie) { %>
Expand Down

0 comments on commit 7362dc1

Please sign in to comment.