opnform/resources/js/middleware/notion-connection.js

19 lines
349 B
JavaScript
Raw Normal View History

2022-09-20 19:59:52 +00:00
import store from '~/store'
export default async (to, from, next) => {
2023-10-27 09:58:01 +00:00
if (store.getters['auth/check'] && store.getters['auth/user'].workspaces_count === 0) {
2022-09-20 19:59:52 +00:00
if ([
'forms.create',
'forms.show',
'forms.edit',
'home'
].includes(to.name)
) {
next({ name: 'onboarding' })
2023-10-27 09:58:01 +00:00
return
2022-09-20 19:59:52 +00:00
}
2023-10-27 09:58:01 +00:00
}
2022-09-20 19:59:52 +00:00
next()
}