opnform/resources/js/middleware/guest.js

11 lines
200 B
JavaScript
Raw Normal View History

import { useAuthStore } from '../stores/auth';
2022-09-20 19:59:52 +00:00
export default (to, from, next) => {
const authStore = useAuthStore()
if (authStore.check) {
2022-09-20 19:59:52 +00:00
next({ name: 'home' })
} else {
next()
}
}