Invitations
Invitations are the default way to add people into an existing organization in NuxtBase.
This flow is not just an email helper. It connects:
- the members page
- Better Auth invitation APIs
- invitation emails
- the
/auth/accept-invitationroute - active organization switching after acceptance
Who Can Send Invitations
Section titled “Who Can Send Invitations”Invitations are restricted to organization managers:
owneradmin
Regular members do not get invitation controls.
Creating an Invitation
Section titled “Creating an Invitation”On the members page, a manager opens the invite modal and submits:
- role (
memberoradmin)
The backend route then calls auth.api.createInvitation() for the target organization.
Invitation Email
Section titled “Invitation Email”The invitation email uses a frontend acceptance URL built like this:
/auth/accept-invitation?id={invitationId}That matters because the invitation flow is completed in the app UI, not in a raw provider callback page.
Pending Invitations
Section titled “Pending Invitations”The members page also shows pending invitations and allows managers to:
- resend an invite
- cancel an invite
Both actions are implemented as real backend routes and also write audit logs.
Accepting an Invitation
Section titled “Accepting an Invitation”The shipped acceptance flow is:
- invited user opens
/auth/accept-invitation?id=... - if the user is not signed in, they are sent to login with a redirect back to the invitation URL
- once authenticated, the app accepts the invitation through the auth client
- the accepted organization is set as the active organization
- the page enters a success state and offers a primary action to continue into the members area
That matters because acceptance is not just “mark invite accepted”. It also updates the current workspace context before the user continues.
Acceptance States
Section titled “Acceptance States”The invitation page handles several states explicitly:
- missing invitation ID
- not signed in yet
- ready to accept
- processing
- accepted
- failed
This makes the flow easier to support and safer to customize.
Role Assignment on Invite
Section titled “Role Assignment on Invite”Current invitation validation allows only:
memberadmin
The template does not use invitation-based owner assignment in the normal dashboard flow.
What To Test
Section titled “What To Test”- invite a
member - confirm the email is sent
- accept the invitation from a separate account
- verify the active organization switches
- resend a pending invitation
- cancel a pending invitation