Skip to content

Commit

Permalink
Merge pull request #816 from supertokens/docs-fixes
Browse files Browse the repository at this point in the history
fix: new tenant pages
  • Loading branch information
rishabhpoddar authored Jul 17, 2024
2 parents 855e0a7 + adbf97c commit de4af78
Show file tree
Hide file tree
Showing 6 changed files with 481 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,10 @@ else:

<CoreInjector defaultValue="http://localhost:3567" showTenantId={false}>

<CoreVersionSubTabs>

<TabItem value="core-9.1">

```bash
curl --location --request PUT '^{coreInjector_uri_without_quotes}/recipe/multitenancy/tenant/v2' \
--header 'api-key: ^{coreInjector_api_key_without_quotes}' \
Expand All @@ -323,6 +327,28 @@ curl --location --request PUT '^{coreInjector_uri_without_quotes}/recipe/multite
}'
```

</TabItem>

<TabItem value="core-9.0">

```bash
curl --location --request PUT '^{coreInjector_uri_without_quotes}/recipe/multitenancy/tenant' \
--header 'api-key: ^{coreInjector_api_key_without_quotes}' \
--header 'Content-Type: application/json' \
--data-raw '{
"tenantId": "customer1",
"coreConfig": {
"email_verification_token_lifetime": 7200000,
"password_reset_token_lifetime": 3600000,
"postgresql_connection_uri": "postgresql://localhost:5432/db2"
}
}'
```

</TabItem>

</CoreVersionSubTabs>

</CoreInjector>

</TabItem>
Expand Down Expand Up @@ -485,40 +511,91 @@ else:

<CoreInjector defaultValue="http://localhost:3567" showAppId showTenantId={false}>

<CoreVersionSubTabs>

<TabItem value="core-9.1">

```bash
curl --location --request GET '^{coreInjector_uri_without_quotes}/customer1/recipe/multitenancy/tenant/v2' \
--header 'api-key: ^{coreInjector_api_key_without_quotes}' \
--header 'Content-Type: application/json'
```

</CoreInjector>
Notice that we added `customer1` to the path of the request. This tells the core that the tenant you want to get the information about is `customer1` (the one we created before in this page).

If the input tenant does not exist, you will get back a `200` status code with the following JSON:

```json
{"status": "TENANT_NOT_FOUND_ERROR"}
```

Otherwise you will get a `200` status code with the following JSON output:

```json
{
"status": "OK",
"thirdParty": {
"providers": [...]
},
"coreConfig": {
"email_verification_token_lifetime": 7200000,
"password_reset_token_lifetime": 3600000,
"postgresql_connection_uri": "postgresql://localhost:5432/db2"
},
"tenantId": "customer1",
"firstFactors": ["emailpassword", "thirdparty", "otp-email", "otp-phone", "link-email", "link-phone"]
}
```

</TabItem>

<TabItem value="core-9.0">

```bash
curl --location --request GET '^{coreInjector_uri_without_quotes}/customer1/recipe/multitenancy/tenant' \
--header 'api-key: ^{coreInjector_api_key_without_quotes}' \
--header 'Content-Type: application/json'
```

Notice that we added `customer1` to the path of the request. This tells the core that the tenant you want to get the information about is `customer1` (the one we created before in this page).

If the input tenant does not exist, you will get back a `200` status code with the following JSON:

```json
{status: "TENANT_NOT_FOUND_ERROR"}
{"status": "TENANT_NOT_FOUND_ERROR"}
```

Otherwise you will get a `200` status code with the following JSON output:

```json
{
"status": "OK",
"emailPassword": {
"enabled": true
},
"thirdParty": {
"enabled": true,
"providers": [...]
},
"passwordless": {
"enabled": true
},
"coreConfig": {
"email_verification_token_lifetime": 7200000,
"password_reset_token_lifetime": 3600000,
"postgresql_connection_uri": "postgresql://localhost:5432/db2"
},
"tenantId": "customer1",
"firstFactors": ["emailpassword", "thirdparty", "otp-email", "otp-phone"],
}
```

</TabItem>

</CoreVersionSubTabs>

</CoreInjector>


</TabItem>

</BackendSDKTabs>
Expand Down
85 changes: 81 additions & 4 deletions v2/multitenancy/new-tenant.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ The built-in Factor IDs that can be used for `firstFactors` are:
<TabItem value="core-9.0">

```bash
curl --location --request PUT '^{coreInjector_uri_without_quotes}/appid-<APP_ID>/recipe/multitenancy/tenant/v2' \
curl --location --request PUT '^{coreInjector_uri_without_quotes}/appid-<APP_ID>/recipe/multitenancy/tenant' \
--header 'api-key: ^{coreInjector_api_key_without_quotes}' \
--header 'Content-Type: application/json' \
--data-raw '{
Expand Down Expand Up @@ -327,6 +327,10 @@ else:

<CoreInjector defaultValue="http://localhost:3567" showTenantId={false}>

<CoreVersionSubTabs>

<TabItem value="core-9.1">

```bash
curl --location --request PUT '^{coreInjector_uri_without_quotes}/recipe/multitenancy/tenant/v2' \
--header 'api-key: ^{coreInjector_api_key_without_quotes}' \
Expand All @@ -341,6 +345,28 @@ curl --location --request PUT '^{coreInjector_uri_without_quotes}/recipe/multite
}'
```

</TabItem>

<TabItem value="core-9.0">

```bash
curl --location --request PUT '^{coreInjector_uri_without_quotes}/recipe/multitenancy/tenant' \
--header 'api-key: ^{coreInjector_api_key_without_quotes}' \
--header 'Content-Type: application/json' \
--data-raw '{
"tenantId": "customer1",
"coreConfig": {
"email_verification_token_lifetime": 7200000,
"password_reset_token_lifetime": 3600000,
"postgresql_connection_uri": "postgresql://localhost:5432/db2"
}
}'
```

</TabItem>

</CoreVersionSubTabs>

</CoreInjector>

</TabItem>
Expand Down Expand Up @@ -503,40 +529,91 @@ else:

<CoreInjector defaultValue="http://localhost:3567" showAppId showTenantId={false}>

<CoreVersionSubTabs>

<TabItem value="core-9.1">

```bash
curl --location --request GET '^{coreInjector_uri_without_quotes}/customer1/recipe/multitenancy/tenant/v2' \
--header 'api-key: ^{coreInjector_api_key_without_quotes}' \
--header 'Content-Type: application/json'
```

</CoreInjector>
Notice that we added `customer1` to the path of the request. This tells the core that the tenant you want to get the information about is `customer1` (the one we created before in this page).

If the input tenant does not exist, you will get back a `200` status code with the following JSON:

```json
{"status": "TENANT_NOT_FOUND_ERROR"}
```

Otherwise you will get a `200` status code with the following JSON output:

```json
{
"status": "OK",
"thirdParty": {
"providers": [...]
},
"coreConfig": {
"email_verification_token_lifetime": 7200000,
"password_reset_token_lifetime": 3600000,
"postgresql_connection_uri": "postgresql://localhost:5432/db2"
},
"tenantId": "customer1",
"firstFactors": ["emailpassword", "thirdparty", "otp-email", "otp-phone", "link-email", "link-phone"]
}
```

</TabItem>

<TabItem value="core-9.0">

```bash
curl --location --request GET '^{coreInjector_uri_without_quotes}/customer1/recipe/multitenancy/tenant' \
--header 'api-key: ^{coreInjector_api_key_without_quotes}' \
--header 'Content-Type: application/json'
```

Notice that we added `customer1` to the path of the request. This tells the core that the tenant you want to get the information about is `customer1` (the one we created before in this page).

If the input tenant does not exist, you will get back a `200` status code with the following JSON:

```json
{status: "TENANT_NOT_FOUND_ERROR"}
{"status": "TENANT_NOT_FOUND_ERROR"}
```

Otherwise you will get a `200` status code with the following JSON output:

```json
{
"status": "OK",
"emailPassword": {
"enabled": true
},
"thirdParty": {
"enabled": true,
"providers": [...]
},
"passwordless": {
"enabled": true
},
"coreConfig": {
"email_verification_token_lifetime": 7200000,
"password_reset_token_lifetime": 3600000,
"postgresql_connection_uri": "postgresql://localhost:5432/db2"
},
"tenantId": "customer1",
"firstFactors": ["emailpassword", "thirdparty", "otp-email", "otp-phone"],
}
```

</TabItem>

</CoreVersionSubTabs>

</CoreInjector>


</TabItem>

</BackendSDKTabs>
Expand Down
Loading

0 comments on commit de4af78

Please sign in to comment.