From e85de31795fc5c1c03c22af4c256bc345c3b0fb2 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Wed, 7 Feb 2024 12:26:43 +0000 Subject: [PATCH] feat: logout endpoint and env & api refactoring --- packages/nocodb/src/services/utils.service.ts | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/packages/nocodb/src/services/utils.service.ts b/packages/nocodb/src/services/utils.service.ts index dd613af719..921d5714f6 100644 --- a/packages/nocodb/src/services/utils.service.ts +++ b/packages/nocodb/src/services/utils.service.ts @@ -1,3 +1,4 @@ +import process from 'process'; import { Injectable } from '@nestjs/common'; import axios from 'axios'; import { compareVersions, validate } from 'compare-versions'; @@ -371,25 +372,16 @@ export class UtilsService { settings = JSON.parse((await Store.get(NC_APP_SETTINGS, true))?.value); } catch {} - const oidcAuthEnabled = !!( - process.env.NC_OIDC_ISSUER && - process.env.NC_OIDC_AUTHORIZATION_URL && - process.env.NC_OIDC_TOKEN_URL && - process.env.NC_OIDC_USERINFO_URL && - process.env.NC_OIDC_CLIENT_ID && - process.env.NC_OIDC_CLIENT_SECRET + const oidcAuthEnabled = ['openid', 'oidc'].includes( + process.env.NC_SSO?.toLowerCase(), ); const oidcProviderName = oidcAuthEnabled ? process.env.NC_OIDC_PROVIDER_NAME ?? 'OpenID Connect' : null; - const samlAuthEnabled = !!( - process.env.NC_SAML_ISSUER && - process.env.NC_SAML_ENTRY_POINT && - process.env.NC_SAML_CERT - ); + const samlAuthEnabled = process.env.NC_SSO?.toLowerCase() === 'saml'; const samlProviderName = samlAuthEnabled - ? process.env.NC_SAML_PROVIDER_NAME ?? 'SAML' + ? process.env.NC_SSO_SAML_PROVIDER_NAME ?? 'SAML' : null; const result = {