activeOrganizationId is null, but user is in Org.

Hey, I tried to get the activeOrganizatuinId with
const session = await auth.api.getSession({
headers: await headers(),
});
console.log(session?.session)
const session = await auth.api.getSession({
headers: await headers(),
});
console.log(session?.session)
but the Output is
{
id: 'Cichg5O1SI3BhWMamq6639gPyv9ZRa1a',
expiresAt: 2025-04-07T06:17:07.437Z,
token: 'erGtW1A8CEHAZmNWJHjYxJGEnX6M2FzY',
createdAt: 2025-03-31T06:17:07.437Z,
updatedAt: 2025-03-31T06:17:07.437Z,
ipAddress: '::1',
userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36',
userId: 'o6IlcNJUkKpxmBLO3jqpzvHlG2JAnHtZ',
activeOrganizationId: null,
impersonatedBy: null
}
{
id: 'Cichg5O1SI3BhWMamq6639gPyv9ZRa1a',
expiresAt: 2025-04-07T06:17:07.437Z,
token: 'erGtW1A8CEHAZmNWJHjYxJGEnX6M2FzY',
createdAt: 2025-03-31T06:17:07.437Z,
updatedAt: 2025-03-31T06:17:07.437Z,
ipAddress: '::1',
userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36',
userId: 'o6IlcNJUkKpxmBLO3jqpzvHlG2JAnHtZ',
activeOrganizationId: null,
impersonatedBy: null
}
But my User is in an Org (see picture).
No description
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?