How to invite user to organization
@Better Auth  How to invite user to organization if user has no account yet and sending invitation will cause error. Current organization doesn't have owner and I want to invite new owner that doesn't yet have account
3 Replies
In Better Auth, only users with the owner role are allowed to send organization invitations. As Document 1 explains, even if you create custom roles with similar permissions, the invite endpoint will still enforce that the inviter has the owner role ([1]). Since your current organization has no owner, attempting to invite a new user—even one intended to become an owner—will trigger an error.
A recommended workaround is to ensure that an account with the owner role is available to send the invitation. This might mean temporarily promoting an existing admin to owner so that they can send the invite, after which you can update roles accordingly after the invite is accepted. Unfortunately, Better Auth does not currently provide a built‐in method to invite a new owner when there isn’t already an owner present in the organization ([1]).
If you’d like to discuss potential feature improvements or further workarounds, please feel free to share your thoughts!
Sources:
[1] Cannot send organization invite without an owner role
GitHub
better-auth/better-auth
The most comprehensive authentication framework for TypeScript - better-auth/better-auth
GitHub
Cannot send organization invite without an owner role · Issue #110...
Is this suited for github? Yes, this is suited for github To Reproduce Follow the installation steps in the docs with the drizzle adapter and postgres database: https://www.better-auth.com/docs/ins...
hi @Better Auth i have this same question, but this time, i am the owner of the organization.
if i send a invite to other user enter in my organization, how this user is going to create the account?i need to use the admin() plugin to create the account of other user before sending the invite?
Hi there! When you send an invite as the organization owner, you don't need to pre-create the user's account using the admin plugin. Instead, Better Auth’s organization invite workflow sends an invitation email (or SMS) that includes a unique invitation link. When the invited user clicks the link, they'll go through a signup/login process where they can create their account using the available authentication methods (password, social sign-in, magic link, etc.) and then be added to your organization [1]. This integrated flow simplifies onboarding, as it handles both the invitation and the eventual user account creation once the invitation is accepted.
Sources:
[1] Organization | Better Auth
Organization | Better Auth
The organization plugin allows you to manage your organization's members and teams.