Add magic link sign-in and harden auth query fallbacks

This commit is contained in:
Matthias
2026-04-01 11:59:47 +02:00
parent d117d6f80c
commit 4065d0ce1c
6 changed files with 115 additions and 5 deletions

View File

@@ -12,7 +12,10 @@ import { optionalAuth, requireAuth } from "./helpers";
export const list = query({
args: {},
handler: async (ctx) => {
const user = await requireAuth(ctx);
const user = await optionalAuth(ctx);
if (!user) {
return [];
}
return await ctx.db
.query("canvases")
.withIndex("by_owner_updated", (q) => q.eq("ownerId", user.userId))