[refactoring] auth as middleware

This commit is contained in:
les
2019-10-30 14:58:40 +01:00
parent a0e2f5e634
commit 0876f9baee
7 changed files with 32 additions and 41 deletions

View File

@@ -149,6 +149,9 @@ export const actions = {
// this method is called server side only for each request
// we use it to get configuration from db, setting locale, etc...
nuxtServerInit ({ commit }, { app, store, req }) {
if (req.user) {
this.$auth.setUser(req.user)
}
const settings = req.settings
commit('setSettings', settings)
// apply settings