# Multi-Workspace Mode

In Multi-Workspace Mode, User can create multiple Workspaces. With some other settings, Admin can control the behavior of Users on Multi-Workspace mode.

### Setting Up Multi-Workspace mode

1. Set LOWCODER\_WORKSPACE\_MODE to "SAAS" in docker-compose-multi.yml file.

{% hint style="info" %}
Workspace Mode Env variable can also have the value "MULTIWORKSPACE" instead of "SAAS"&#x20;
{% endhint %}

<figure><img src="https://934254130-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjNgeI0mUzgw6Re92iTOw%2Fuploads%2FsLPOeCq1zQhum750v0zy%2Fframe_generic_light%20(4).png?alt=media&#x26;token=ed723d62-a6a8-401e-93fe-d436cf8d8bac" alt=""><figcaption></figcaption></figure>

You can see in the following screenshot that in "Multi-Workspace" mode, each User can create multiple Workspaces.

<figure><img src="https://934254130-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjNgeI0mUzgw6Re92iTOw%2Fuploads%2FZjgxcI4dedlKbFiHg7DS%2Fframe_generic_light%20(5).png?alt=media&#x26;token=535d2ac0-cd0d-4f1e-a7f2-0ad771f9823a" alt=""><figcaption></figcaption></figure>

1. In the above screenshot, you can see three configuration variables regarding Email and Workspace creation on Sign up.
   1. **LOWCODER\_EMAIL\_SIGNUP\_ENABLED**\
      \
      This variable is the configuration for showing "Sign Up" button on Lowcoder. When it is set to "TRUE", "Sign Up" button will show up and new User can sign up in Multi-Workspace mode. A new Workspace will be created for this User, and he/she will be the Admin of this Workspace : \
      \
      LOWCODE\_EMAIL\_SIGNUP\_ENABLED = **true**<br>

      <figure><img src="https://934254130-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjNgeI0mUzgw6Re92iTOw%2Fuploads%2FTMxjx0Zyw1auccikDRtB%2Fframe_generic_light%20(1).png?alt=media&#x26;token=05958c25-fdd7-4e03-b95d-a1016aadecc4" alt=""><figcaption></figcaption></figure>

      LOWCODE\_EMAIL\_SIGNUP\_ENABLED = **false**<br>

      <figure><img src="https://934254130-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjNgeI0mUzgw6Re92iTOw%2Fuploads%2FL8yKK4jvF00Y7nEi8qc1%2Fframe_generic_light%20(2).png?alt=media&#x26;token=ab8fceed-ccee-4325-8c93-f52726880d14" alt=""><figcaption></figcaption></figure>
   2. **LOWCODER\_CREATE\_WORKSPACE\_ON\_SIGNUP**\
      \
      This variable is the configuration for creating a Workspace when new User signs up.\
      \
      LOWCODER\_CREATE\_WORKSPACE\_ON\_SIGNUP = **true**<br>

      <figure><img src="https://934254130-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjNgeI0mUzgw6Re92iTOw%2Fuploads%2FFmGe2URME9cEzNObmLgM%2Fframe_generic_light%20(6).png?alt=media&#x26;token=80dfd3ef-ae21-4c40-aa91-ba1a3469d10c" alt=""><figcaption></figcaption></figure>

      LOWCODER\_CREATE\_WORKSPACE\_ON\_SIGNUP = **false**<br>

      <figure><img src="https://934254130-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjNgeI0mUzgw6Re92iTOw%2Fuploads%2FJEsoL3d2lwXpeIY01qLz%2Fframe_generic_light%20(11).png?alt=media&#x26;token=ccbf3090-d275-4cd8-86d6-fcf4edee405a" alt=""><figcaption></figcaption></figure>

### Scenarios

1. LOWCODER\_WORKSPACE\_MODE = SAAS
2. LOWCODER\_EMAIL\_SIGNUP\_ENABLED = true
3. LOWCODER\_CREATE\_WORKSPACE\_ON\_SIGNUP =  true

| Scenario                           | Subscenario                                                                                     | Expected Result                                                                                                                                                                                                                                      |
| ---------------------------------- | ----------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Can Workspace Admins login normal  |                                                                                                 |                                                                                                                                                                                                                                                      |
|                                    | If they are Admin of a single workspace                                                         | Admin should get redirected to Password screen and relevant OAuth methods should get displayed if these are configured.                                                                                                                              |
|                                    | if they are Admin of multiple workspaces                                                        | Admin should be displayed with the option to choose from Workspaces he/she is Admin of. After selecting a Workspace, Lowcoder should redirect to Password screen and relevant OAuth methods should get displayed if these are configured.            |
|                                    | If they are Admin on Workspace A, but Member on Workspace B                                     | Admin should be displayed with the option to choose from Workspaces he/she is Admin of. After selecting a Workspace, Lowcoder should redirect to Password screen and relevant OAuth methods should get displayed if these are configured.            |
| Can Workspace Members login normal |                                                                                                 |                                                                                                                                                                                                                                                      |
|                                    | If they are Member at a single Workspace                                                        | Member should get redirected to Password screen and relevant OAuth methods should get displayed if these are configured.                                                                                                                             |
|                                    | If they are Member at multiple Workspaces                                                       | Member should be displayed with the option to choose from Workspaces he/she is Member of. After selecting a Workspace, Lowcoder should redirect to Password screen and relevant OAuth methods should get displayed if these are configured.          |
|                                    | If they are Member at Workspace A, but Admin on Workspace B                                     | Member should be displayed with the option to choose from Workspaces he/she is Member or Admin of. After selecting a Workspace, Lowcoder should redirect to Password screen and relevant OAuth methods should get displayed if these are configured. |
| New User Sign up                   |                                                                                                 |                                                                                                                                                                                                                                                      |
|                                    | Can New User sign up as an Admin                                                                | Yes. Any New User will the Admin of their Workspace as they Sign up                                                                                                                                                                                  |
|                                    | Can New User sign up as a Member                                                                | By default, No. but, if they join another Workspace through the Invite link, then they will Sign up as a Member.                                                                                                                                     |
|                                    | Can Admin create a New Workspace                                                                | Yes. Admin can create multiple Workspaces                                                                                                                                                                                                            |
|                                    | Can Admin update the Role of a Member to Developer                                              | Yes. It is possible.                                                                                                                                                                                                                                 |
| Create Workspace on Sign up        |                                                                                                 |                                                                                                                                                                                                                                                      |
|                                    | Is a New Workspace get created when new Member signs up ?                                       | New Workspace should get created when a new Member signs up.                                                                                                                                                                                         |
|                                    | Is a New Workspace get created when a new Member signs up using another Workspace Invite link ? | New Member should get added as Member on the Workspace he/she joined in, and No New Workspace should get created.                                                                                                                                    |

| Scenario                         | LOWCODER\_EMAIL\_SIGNUP\_ENABLED | LOWCODER\_CREATE\_WORKSPACE\_ON\_SIGNUP | Disable Email Auth |
| -------------------------------- | -------------------------------- | --------------------------------------- | ------------------ |
| Can Admin/Member Sign up / Login | True                             | True                                    | Enabled            |
| Can Admin/Member Sign up / Login | True                             | True                                    | Disabled           |
| ....                             | True                             | False                                   | Enabled            |
| ....                             | True                             | False                                   | Disabled           |
| ....                             | False                            | True                                    | Enabled            |
| ....                             | False                            | True                                    | Disabled           |
| Can Admin/Member Sign up / Login | False                            | False                                   | Enabled            |
| Can Admin/Member Sign up / Login | False                            | False                                   | Disabled           |

Let's explain the above scenarios with different settings of the Environment Variables.\
\
**LOWCODER\_EMAIL\_SIGNUP\_ENABLED**

This Env variable controls the Sign up feature whether New Users can Sign Pp or not. If set to False, Sign up button is not shown up and if a new User tries to enter an email and go forward, User is not shown the Sign up page.

\
![](https://934254130-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjNgeI0mUzgw6Re92iTOw%2Fuploads%2F9HM6yIlQzvDsnqj7rKEN%2Fframe_generic_light%20\(7\).png?alt=media\&token=f63f8d9c-b038-4435-82b6-84bb4d4a871f)

**LOWCODER\_CREATE\_WORKSPACE\_ON\_SIGNUP**

This Env variable controls the creation of a Workspace when a new User signs up. If set to False, a new User will get added to the Default Workspace.

**Disable Email Auth**

<figure><img src="https://934254130-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjNgeI0mUzgw6Re92iTOw%2Fuploads%2F1gjtxvqSPrbn6uoVbDuA%2Fframe_generic_light%20(10).png?alt=media&#x26;token=5b108f5b-5d16-4135-abfa-c6a3c810c1d0" alt=""><figcaption></figcaption></figure>

This feature controls the Sign up/Login using standard Email field. When set to disabled, Email field won't show up on Sign Up and Login pages, and User won't be able to Sign up or Login using Email field. \
\
\
**Scenario: When LOWCODER\_EMAIL\_SIGNUP\_ENABLED = False**

<figure><img src="https://934254130-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjNgeI0mUzgw6Re92iTOw%2Fuploads%2FLYDI3fJAZmC6uF1qhM4E%2Fframe_generic_light%20(8).png?alt=media&#x26;token=e4d63136-92de-4ba0-a428-9deb45aa6e31" alt="" width="375"><figcaption></figcaption></figure>

This means that New User can't Sign up on a Workspace. So, LOWCODER\_CREATE\_WORKSPACE\_ON\_SIGNUP Env variable won't matter.&#x20;

Now, if Email Auth is "disabled", then User can only sign in using other Auth Providers, but still New User should NOT be able to Sign up.

### Administrative Access

Here, if Admin disables the "Email Auth" ( means that Members can't Sign up/Login using Standard Email field ), Lowcoder allows Admin to still be able to login using /admin/auth/login. But, for other Users, Email field won't be available at /user/auth/login. They would only be able to see other Auth Providers options set by Admin.\
\
**View on /user/auth/login**

<figure><img src="https://934254130-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjNgeI0mUzgw6Re92iTOw%2Fuploads%2FwawyFXuZHqnX7qCdeRHx%2Fframe_generic_light%20(16).png?alt=media&#x26;token=b50a266a-4e33-46e1-8f25-d65c5e9847c6" alt=""><figcaption></figcaption></figure>

**View on /admin/login**

<figure><img src="https://934254130-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjNgeI0mUzgw6Re92iTOw%2Fuploads%2F5NSX64aLdDRixz0WJqw3%2Fframe_generic_light%20(14).png?alt=media&#x26;token=f2d88b72-29dd-4455-9a5a-9ba68bc4002f" alt=""><figcaption></figcaption></figure>

**Scenario: When LOWCODER\_EMAIL\_SIGNUP\_ENABLED = True**\
\
If LOWCODER\_CREATE\_WORKSPACE\_ON\_SIGNUP is set to "True", then for every new Sign Up, a New Workspace will be created for the User.&#x20;

<figure><img src="https://934254130-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjNgeI0mUzgw6Re92iTOw%2Fuploads%2F0wL8a51WaF8QEXo3uAXL%2Fframe_generic_light%20(12).png?alt=media&#x26;token=a5bc7f80-5be8-49a9-8575-39f93d295abf" alt=""><figcaption></figcaption></figure>
