feat(*): allow to select auth providers + add multiworkspace with subdomain management (#8656)
## Summary Add support for multi-workspace feature and adjust configurations and states accordingly. - Introduced new state isMultiWorkspaceEnabledState. - Updated ClientConfigProviderEffect component to handle multi-workspace. - Modified GraphQL schema and queries to include multi-workspace related configurations. - Adjusted server environment variables and their respective documentation to support multi-workspace toggle. - Updated server-side logic to handle new multi-workspace configurations and conditions.
This commit is contained in:
@ -2,30 +2,6 @@ import { Field, ObjectType } from '@nestjs/graphql';
|
||||
|
||||
import { CaptchaDriverType } from 'src/engine/core-modules/captcha/interfaces';
|
||||
|
||||
@ObjectType()
|
||||
class AuthProviders {
|
||||
@Field(() => Boolean)
|
||||
google: boolean;
|
||||
|
||||
@Field(() => Boolean)
|
||||
magicLink: boolean;
|
||||
|
||||
@Field(() => Boolean)
|
||||
password: boolean;
|
||||
|
||||
@Field(() => Boolean)
|
||||
microsoft: boolean;
|
||||
|
||||
@Field(() => Boolean)
|
||||
sso: boolean;
|
||||
}
|
||||
|
||||
@ObjectType()
|
||||
class Telemetry {
|
||||
@Field(() => Boolean)
|
||||
enabled: boolean;
|
||||
}
|
||||
|
||||
@ObjectType()
|
||||
class Billing {
|
||||
@Field(() => Boolean)
|
||||
@ -76,9 +52,6 @@ class ApiConfig {
|
||||
|
||||
@ObjectType()
|
||||
export class ClientConfig {
|
||||
@Field(() => AuthProviders, { nullable: false })
|
||||
authProviders: AuthProviders;
|
||||
|
||||
@Field(() => Billing, { nullable: false })
|
||||
billing: Billing;
|
||||
|
||||
@ -86,7 +59,16 @@ export class ClientConfig {
|
||||
signInPrefilled: boolean;
|
||||
|
||||
@Field(() => Boolean)
|
||||
signUpDisabled: boolean;
|
||||
isMultiWorkspaceEnabled: boolean;
|
||||
|
||||
@Field(() => Boolean)
|
||||
isSSOEnabled: boolean;
|
||||
|
||||
@Field(() => String, { nullable: true })
|
||||
defaultSubdomain: string;
|
||||
|
||||
@Field(() => String)
|
||||
frontDomain: string;
|
||||
|
||||
@Field(() => Boolean)
|
||||
debugMode: boolean;
|
||||
|
||||
@ -11,13 +11,6 @@ export class ClientConfigResolver {
|
||||
@Query(() => ClientConfig)
|
||||
async clientConfig(): Promise<ClientConfig> {
|
||||
const clientConfig: ClientConfig = {
|
||||
authProviders: {
|
||||
google: this.environmentService.get('AUTH_GOOGLE_ENABLED'),
|
||||
magicLink: false,
|
||||
password: this.environmentService.get('AUTH_PASSWORD_ENABLED'),
|
||||
microsoft: this.environmentService.get('AUTH_MICROSOFT_ENABLED'),
|
||||
sso: this.environmentService.get('AUTH_SSO_ENABLED'),
|
||||
},
|
||||
billing: {
|
||||
isBillingEnabled: this.environmentService.get('IS_BILLING_ENABLED'),
|
||||
billingUrl: this.environmentService.get('BILLING_PLAN_REQUIRED_LINK'),
|
||||
@ -25,8 +18,13 @@ export class ClientConfigResolver {
|
||||
'BILLING_FREE_TRIAL_DURATION_IN_DAYS',
|
||||
),
|
||||
},
|
||||
isSSOEnabled: this.environmentService.get('AUTH_SSO_ENABLED'),
|
||||
signInPrefilled: this.environmentService.get('SIGN_IN_PREFILLED'),
|
||||
signUpDisabled: this.environmentService.get('IS_SIGN_UP_DISABLED'),
|
||||
isMultiWorkspaceEnabled: this.environmentService.get(
|
||||
'IS_MULTIWORKSPACE_ENABLED',
|
||||
),
|
||||
defaultSubdomain: this.environmentService.get('DEFAULT_SUBDOMAIN'),
|
||||
frontDomain: this.environmentService.get('FRONT_DOMAIN'),
|
||||
debugMode: this.environmentService.get('DEBUG_MODE'),
|
||||
support: {
|
||||
supportDriver: this.environmentService.get('SUPPORT_DRIVER'),
|
||||
|
||||
Reference in New Issue
Block a user