Open source Loom alternative. Beautiful, shareable screen recordings.
Rust appcapcossloommacnextjsnextjs15open-sourceossreactrecordrustscreen-capturescreen-recorderscreenshotsolidjstauritauri-apptypescriptvite
fix(database): guard session token id with optional chaining
Richie McIlroyed219f1bac62
diff --git a/packages/database/auth/auth-options.ts b/packages/database/auth/auth-options.tsindex f5b39b3a4..4d9fa71a1 100644--- a/packages/database/auth/auth-options.ts+++ b/packages/database/auth/auth-options.ts@@ -152,7 +152,7 @@ export const authOptions = (): NextAuthOptions => {async session({ token, session }) {if (!session.user) return session;- if (token && token.id && typeof token.id === "string") {+ if (token?.id && typeof token.id === "string") {(session.user as { id: string }).id = token.id;session.user.name = token.name ?? null;session.user.email = token.email ?? null;