BA
Better Auth•4mo ago
qwerzl

Is there a superadmin role that lets you manage every organization?

hey guys, I'm building an admin portal for my company's project. We need to be able to manage (delete/edit/send invitation) every organization even if the operator is not in that organization. Is it possible in better-auth?
Solution:
https://github.com/better-auth/better-auth/issues/1595 Turned out it isn't available yet. I added a hook on /oauth2/redirect to automatically add users logged in through our internal IdP to a special organization, then added a server action to directly modify the database if that user is a part of the special organization. ugly but it works 😅...
GitHub
Cannot update and delete an organization as user admin (super admin...
Is this suited for github? Yes, this is suited for github Is your feature request related to a problem? Please describe. Hello, Is it possible to delete an organization when a user has the "ad...
Jump to solution
4 Replies
Shifty
Shifty•4mo ago
i handled this myself by adjusting the users table to have an isSuperAdmin boolean flag and then just handle checks within the app to essentially give them all capabilities
AbdallahGamal
AbdallahGamal•4mo ago
I think you can just use both the admin plugin and the organization plugin
Solution
qwerzl
qwerzl•4mo ago
https://github.com/better-auth/better-auth/issues/1595 Turned out it isn't available yet. I added a hook on /oauth2/redirect to automatically add users logged in through our internal IdP to a special organization, then added a server action to directly modify the database if that user is a part of the special organization. ugly but it works 😅
GitHub
Cannot update and delete an organization as user admin (super admin...
Is this suited for github? Yes, this is suited for github Is your feature request related to a problem? Please describe. Hello, Is it possible to delete an organization when a user has the "ad...
qwerzl
qwerzlOP•4mo ago
iirc authClient.admin does not provide any apis related to organizations.

Did you find this page helpful?