feat(): enable custom domain usage (#9911)
# Content - Introduce the `workspaceUrls` property. It contains two sub-properties: `customUrl, subdomainUrl`. These endpoints are used to access the workspace. Even if the `workspaceUrls` is invalid for multiple reasons, the `subdomainUrl` remains valid. - Introduce `ResolveField` workspaceEndpoints to avoid unnecessary URL computation on the frontend part. - Add a `forceSubdomainUrl` to avoid custom URL using a query parameter
This commit is contained in:
@ -2,4 +2,5 @@
|
||||
|
||||
export enum BillingEntitlementKey {
|
||||
SSO = 'SSO',
|
||||
CUSTOM_DOMAIN = 'CUSTOM_DOMAIN',
|
||||
}
|
||||
|
||||
@ -47,7 +47,7 @@ export class BillingPortalWorkspaceService {
|
||||
requirePaymentMethod,
|
||||
}: BillingPortalCheckoutSessionParameters): Promise<string> {
|
||||
const frontBaseUrl = this.domainManagerService.buildWorkspaceURL({
|
||||
subdomain: workspace.subdomain,
|
||||
workspace,
|
||||
});
|
||||
const cancelUrl = frontBaseUrl.toString();
|
||||
|
||||
@ -118,7 +118,7 @@ export class BillingPortalWorkspaceService {
|
||||
}
|
||||
|
||||
const frontBaseUrl = this.domainManagerService.buildWorkspaceURL({
|
||||
subdomain: workspace.subdomain,
|
||||
workspace,
|
||||
});
|
||||
|
||||
if (returnUrlPath) {
|
||||
|
||||
@ -41,6 +41,12 @@ describe('transformStripeEntitlementUpdatedEventToDatabaseEntitlement', () => {
|
||||
value: true,
|
||||
stripeCustomerId: 'cus_123',
|
||||
},
|
||||
{
|
||||
key: BillingEntitlementKey.CUSTOM_DOMAIN,
|
||||
stripeCustomerId: 'cus_123',
|
||||
value: false,
|
||||
workspaceId: 'workspaceId',
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
||||
@ -79,6 +85,12 @@ describe('transformStripeEntitlementUpdatedEventToDatabaseEntitlement', () => {
|
||||
value: false,
|
||||
stripeCustomerId: 'cus_123',
|
||||
},
|
||||
{
|
||||
key: 'CUSTOM_DOMAIN',
|
||||
stripeCustomerId: 'cus_123',
|
||||
value: false,
|
||||
workspaceId: 'workspaceId',
|
||||
},
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user