Is it possible to add multiple authentication systems?

In my app, I have a the better auth user authentication system, but I want to use organizations as tenants. Each organization should have its own authentication system, allowing ‘Participants’ within an organization to log in separately. Is this possible? One way I was thinking was to have two instances of better auth, but maybe that becomes too much?
3 Replies
Nicky Dicky
Nicky Dicky2mo ago
you could just do an additional field and list the organization that the participant has access to
Levin
LevinOP2mo ago
So you mean a new role right? @Nicky Dicky
Nicky Dicky
Nicky Dicky2mo ago
you could use roles from better auth, or you could do a custom additional field make middleware that checks if the logged in user has access to that organization then wrap it around the parts you want to protect

Did you find this page helpful?