feat(admin): add categories and teams management page
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
export default defineNuxtRouteMiddleware(async () => {
|
||||
export default defineNuxtRouteMiddleware(async (to) => {
|
||||
const auth = useAuth()
|
||||
|
||||
if ((auth.token.value || auth.tokenState.value) && !auth.user.value && !auth.isSyncingUser.value) {
|
||||
try {
|
||||
await auth.syncUser()
|
||||
await auth.syncUser({ currentPath: to.path })
|
||||
} catch (error) {
|
||||
console.error('[Guest Middleware] Sync failed:', error)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user