opnform/resources/js/middleware/admin.js

10 lines
164 B
JavaScript
Raw Normal View History

2022-09-20 19:59:52 +00:00
import store from '~/store'
export default (to, from, next) => {
if (!store.getters['auth/user'].admin) {
next({ name: 'home' })
} else {
next()
}
}