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

925
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -39,13 +39,11 @@
<script>
import { inputProps, useFormInput } from './useFormInput.js'
import InputLabel from './components/InputLabel.vue'
import InputHelp from './components/InputHelp.vue'
import InputWrapper from './components/InputWrapper.vue'
export default {
name: 'TextInput',
components: { InputWrapper, InputHelp, InputLabel },
components: { InputWrapper },
props: {
...inputProps,

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()
}