opnform/client/middleware/subscribed.js

8 lines
202 B
JavaScript
Raw Normal View History

2023-12-16 18:21:03 +00:00
export default defineNuxtRouteMiddleware((to, from) => {
const authStore = useAuthStore()
if (authStore.check && !authStore.user?.is_subscribed) {
return navigateTo({ name: 'pricing' })
}
})