Skip to content

Instantly share code, notes, and snippets.

@gufranmirza
Created July 8, 2019 17:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gufranmirza/5d82572098b68b15929af0a37b820a5a to your computer and use it in GitHub Desktop.
Save gufranmirza/5d82572098b68b15929af0a37b820a5a to your computer and use it in GitHub Desktop.
// store/index.js
actions: {
nuxtServerInit ({ commit}, { req }) {
if (req.session.user) {
commit('setUser', req.session.user);
return axios.get(`/users/${req.session.user}`).then((response) =>{
commit('currentUserData', response.data);
})
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment