opnform/resources/js/middleware/guest.js

11 lines
200 B
JavaScript

import { useAuthStore } from '../stores/auth';
export default (to, from, next) => {
const authStore = useAuthStore()
if (authStore.check) {
next({ name: 'home' })
} else {
next()
}
}