opnform/client/middleware/subscribed.js

8 lines
202 B
JavaScript

export default defineNuxtRouteMiddleware((to, from) => {
const authStore = useAuthStore()
if (authStore.check && !authStore.user?.is_subscribed) {
return navigateTo({ name: 'pricing' })
}
})