Browse Source

Reduce the number of calling me api

pull/1274/head
Hironsan 3 years ago
parent
commit
5a5731178e
1 changed files with 4 additions and 2 deletions
  1. 6
      frontend/middleware/check-auth.js

6
frontend/middleware/check-auth.js

@ -1,3 +1,5 @@
export default async function(context) {
await context.store.dispatch('auth/initAuth', context.req)
export default async function({ store }) {
if (!store.getters['auth/isAuthenticated']) {
await store.dispatch('auth/initAuth')
}
}
Loading…
Cancel
Save