mirror of
https://github.com/LukeHagar/better-auth.git
synced 2025-12-10 12:27:44 +00:00
fix: org adapter shouldn't use dynamic table names
This commit is contained in:
@@ -70,7 +70,7 @@ export const getOrgAdapter = (
|
||||
organizationId: string;
|
||||
}) => {
|
||||
const user = await adapter.findOne<User>({
|
||||
model: context.tables.user.modelName,
|
||||
model: "user",
|
||||
where: [
|
||||
{
|
||||
field: "email",
|
||||
@@ -126,7 +126,7 @@ export const getOrgAdapter = (
|
||||
],
|
||||
}),
|
||||
await adapter.findOne<User>({
|
||||
model: context.tables.user.modelName,
|
||||
model: "user",
|
||||
where: [
|
||||
{
|
||||
field: "id",
|
||||
@@ -162,7 +162,7 @@ export const getOrgAdapter = (
|
||||
return null;
|
||||
}
|
||||
const user = await adapter.findOne<User>({
|
||||
model: context.tables.user.modelName,
|
||||
model: "user",
|
||||
where: [
|
||||
{
|
||||
field: "id",
|
||||
@@ -268,7 +268,7 @@ export const getOrgAdapter = (
|
||||
organizationId: string | null,
|
||||
) => {
|
||||
const session = await adapter.update<Session>({
|
||||
model: context.tables.session.modelName,
|
||||
model: "session",
|
||||
where: [
|
||||
{
|
||||
field: "id",
|
||||
@@ -316,7 +316,7 @@ export const getOrgAdapter = (
|
||||
|
||||
const userIds = members.map((member) => member.userId);
|
||||
const users = await adapter.findMany<User>({
|
||||
model: context.tables.user.modelName,
|
||||
model: "user",
|
||||
where: [{ field: "id", value: userIds, operator: "in" }],
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user