Initial commit from monorepo

This commit is contained in:
Ruslan Bakiev
2026-01-07 09:10:35 +07:00
commit 3db50d9637
371 changed files with 43223 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
export default defineNuxtRouteMiddleware(async () => {
const { activeLogtoOrgId, setActiveTeam } = useActiveTeam()
const me = useState<{
activeTeamId?: string | null
activeTeam?: { logtoOrgId?: string | null } | null
} | null>('me', () => null)
// Already loaded - skip
if (activeLogtoOrgId.value) return
if (!me.value?.activeTeamId || !me.value.activeTeam?.logtoOrgId) return
setActiveTeam(me.value.activeTeamId, me.value.activeTeam.logtoOrgId)
})

View File

@@ -0,0 +1,17 @@
export default defineNuxtRouteMiddleware(async (to) => {
// Skip auth routes handled by @logto/nuxt
if (to.path === '/sign-in' || to.path === '/sign-out' || to.path === '/callback') {
return
}
// Skip public auth paths
if (to.path.startsWith('/auth/')) {
return
}
const { loggedIn } = useAuth()
if (!loggedIn.value) {
return navigateTo('/sign-in')
}
})