mirror of
https://github.com/better-auth/better-auth.git
synced 2026-05-28 09:56:25 -05:00
fix: set active should use token instead of id
This commit is contained in:
@@ -274,12 +274,12 @@ export const setActiveOrganization = createAuthEndpoint(
|
||||
if (!sessionOrgId) {
|
||||
return ctx.json(null);
|
||||
}
|
||||
await adapter.setActiveOrganization(session.session.id, null);
|
||||
const updatedSession = await adapter.setActiveOrganization(
|
||||
session.session.token,
|
||||
null,
|
||||
);
|
||||
await setSessionCookie(ctx, {
|
||||
session: {
|
||||
...session.session,
|
||||
activeOrganizationId: null,
|
||||
},
|
||||
session: updatedSession,
|
||||
user: session.user,
|
||||
});
|
||||
return ctx.json(null);
|
||||
|
||||
Reference in New Issue
Block a user