Browse Source

feat: add config options

pull/7569/head
Pranav C 10 months ago
parent
commit
3878d6b022
  1. 2
      packages/nc-gui/composables/useGlobal/state.ts
  2. 2
      packages/nc-gui/composables/useGlobal/types.ts
  3. 11
      packages/nocodb/src/services/utils.service.ts

2
packages/nc-gui/composables/useGlobal/state.ts

@ -96,6 +96,8 @@ export function useGlobalState(storageKey = 'nocodb-gui-v2'): State {
googleAuthEnabled: false, googleAuthEnabled: false,
oidcAuthEnabled: false, oidcAuthEnabled: false,
oidcProviderName: null, oidcProviderName: null,
samlAuthEnabled: false,
samlProviderName: null,
ncMin: false, ncMin: false,
oneClick: false, oneClick: false,
baseHasAdmin: false, baseHasAdmin: false,

2
packages/nc-gui/composables/useGlobal/types.ts

@ -35,6 +35,8 @@ export interface AppInfo {
mainSubDomain?: string mainSubDomain?: string
dashboardPath: string dashboardPath: string
inviteOnlySignup: boolean inviteOnlySignup: boolean
samlAuthEnabled: boolean
samlProviderName: string | null
} }
export interface StoredState { export interface StoredState {

11
packages/nocodb/src/services/utils.service.ts

@ -383,6 +383,15 @@ export class UtilsService {
? process.env.NC_OIDC_PROVIDER_NAME ?? 'OpenID Connect' ? process.env.NC_OIDC_PROVIDER_NAME ?? 'OpenID Connect'
: null; : null;
const samlAuthEnabled = !!(
process.env.NC_SAML_ISSUER &&
process.env.NC_SAML_ENTRY_POINT &&
process.env.NC_SAML_CERT
);
const samlProviderName = samlAuthEnabled
? process.env.NC_SAML_PROVIDER_NAME ?? 'SAML'
: null;
const result = { const result = {
authType: 'jwt', authType: 'jwt',
baseHasAdmin, baseHasAdmin,
@ -422,6 +431,8 @@ export class UtilsService {
mainSubDomain: this.configService.get('mainSubDomain', { infer: true }), mainSubDomain: this.configService.get('mainSubDomain', { infer: true }),
dashboardPath: this.configService.get('dashboardPath', { infer: true }), dashboardPath: this.configService.get('dashboardPath', { infer: true }),
inviteOnlySignup: settings.invite_only_signup, inviteOnlySignup: settings.invite_only_signup,
samlProviderName,
samlAuthEnabled,
}; };
return result; return result;

Loading…
Cancel
Save