[Organization]: Setting Active organization with slug fails.
When I try to set my active organization via slug, I getting a 403 'User is not a member of the organization', when I do it with the id it works fine.
4 Replies
I calling with
authClient.useListOrganizations()
all my organization but when I want to set one as active I get an 403 with message User is not a member of the organization
. I checked in my db the users as well and he is part of organization. Do i miss something?
my snippet:
This snippet works fine only with idI'm getting the same error, and this happening in better-auth version 1.3.2 and above, setting it to 1.3.1 fixes it
did some research and this commit might be the issue of this: https://github.com/better-auth/better-auth/commit/bc88ade07c62223c790b9df584dd27cf69f350aa
there is fix PR here: https://github.com/better-auth/better-auth/pull/3540
GitHub
fix(organization): resolve slug when setting active organization by...
closes #3528
Summary by cubic
Fixed an issue where setting the active organization did not resolve organization slugs correctly. Now, both organization IDs and slugs are properly handled when upd...