streaming, markdown, model selecting, and lots more

This commit is contained in:
Zoe
2026-02-02 23:16:06 -06:00
parent 8c28946703
commit d5a5945c03
114 changed files with 6109 additions and 2938 deletions
+16 -10
View File
@@ -1,13 +1,19 @@
export default defineNuxtRouteMiddleware(async (to) => {
const { loggedIn } = useAuth()
const { session, fetchSession } = useAuth();
// if authenticated, and on a signin/signup page, redirect to home page
if (to.path.toLowerCase().includes('/auth/') && loggedIn.value) {
return navigateTo('/')
}
if (!session.value) {
await fetchSession();
}
// If not authenticated, and not on a signin/signup page, redirect to login page
if (!loggedIn.value && !to.path.toLowerCase().includes('/auth/')) {
return navigateTo('/auth/login')
}
})
const loggedIn = computed(() => !!session.value);
// if authenticated, and on a signin/signup page, redirect to home page
if (to.path.toLowerCase().includes("/auth/") && loggedIn.value) {
return await navigateTo((to.query.to as string) ?? "/");
}
// If not authenticated, and not on a signin/signup page, redirect to login page
if (!loggedIn.value && !to.path.toLowerCase().includes("/auth/")) {
return await navigateTo(`/auth/login?to=${to.path}`);
}
});