Fix check-auth middleware

This commit is contained in:
Julien Nahum
2023-10-27 10:58:01 +01:00
parent 437644584a
commit 7eb546703f
4 changed files with 327 additions and 616 deletions

View File

@@ -41,11 +41,12 @@ export default async (to, from, next) => {
store.getters['auth/token'] !== undefined
) {
try {
const user = await store.dispatch('auth/fetchUser')
initCrisp(user)
initSentry(user)
store.dispatch('auth/fetchUser').then((user) => {
initCrisp(user)
initSentry(user)
})
} catch (e) {
console.log(e, 'error')
console.error(e)
}
}
next()

View File

@@ -1,7 +1,7 @@
import store from '~/store'
export default async (to, from, next) => {
/* if (store.getters['auth/check'] && store.getters['auth/user'].workspaces_count === 0) {
if (store.getters['auth/check'] && store.getters['auth/user'].workspaces_count === 0) {
if ([
'forms.create',
'forms.show',
@@ -10,8 +10,9 @@ export default async (to, from, next) => {
].includes(to.name)
) {
next({ name: 'onboarding' })
return
}
}*/
}
next()
}