hello supertokens I want to use multinenancy and at the same time I don't want to do tenant selectio...
z
hello supertokens I want to use multinenancy and at the same time I don't want to do tenant selection in the login process. I just need to make the user login with email and password input. I want the logged in email to enter the tenant in which tenant it is registered, how can I do this.
r
hey @zafer7929
for this, you will need to do the following: - All users will be a part of the default,
public
tenant. Which will be configured to have email password login. You can implement this part by following the regular quick setup guide of the email password recipe docs. Nothing to do with multi tenancy here. - Once a user logs in, you can add them to another tenant as shown here: https://supertokens.com/docs/multitenancy/users-and-tenants. So this way, a user is a part of the
public
tenant along with whatever other tenant you add them to. - Then you can also ask the user to switch tenants (custom UI) and when they select a tenant they want to switch to, you can call the createNewSession function with the selected tenant: https://supertokens.com/docs/session/common-customizations/sessions/new-session
z
hey @rp_st Is it possible to effectively implement a multitenancy architecture without specifying any particular tenant or using 'public' as the default value?
r
yea. Thats what you do when you follow the regular quick setup docs.
So basically, your login / sign up has nothing to do with multi tenancy. And users there are automatically added to the
public
tenant.