Changed error boundary to cover both full hub and disaptch app

This commit is contained in:
PxlLoewe
2025-05-29 22:25:30 -07:00
parent d968507484
commit 0cebe2b97e
24 changed files with 226 additions and 194 deletions

View File

@@ -70,9 +70,25 @@ export const options: AuthOptions = {
return token;
},
session: async ({ session, user, token }) => {
const dbUser = await prisma.user.findUnique({
where: {
id: token?.sub,
},
});
if (!dbUser) {
return {
...session,
user: {
name: null,
email: null,
image: null,
},
expires: new Date().toISOString(),
};
}
return {
...session,
user: token,
user: dbUser,
};
},
},