Bug on Auth.

This commit is contained in:
charles-gauthereau
2025-01-03 22:02:52 +01:00
parent d42d73661e
commit dca1799aac
+10 -1
View File
@@ -117,7 +117,16 @@ export const {handlers, auth: baseAuth, signIn, signOut} = NextAuth({
const defaultOrganization = await prisma.organization.findUnique({
where: {slug: "default"},
include: {users: {}}
include: {users: {
include:{
user: true
},
where:{
user: {
deleted: {not: true},
}
}
}}
});
const organizationRole = defaultOrganization.users.length > 0 ? "member" : "admin"