Browse Source

feat: logout endpoint and env & api refactoring

pull/7569/head
Pranav C 11 months ago
parent
commit
e85de31795
  1. 18
      packages/nocodb/src/services/utils.service.ts

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

@ -1,3 +1,4 @@
import process from 'process';
import { Injectable } from '@nestjs/common'; import { Injectable } from '@nestjs/common';
import axios from 'axios'; import axios from 'axios';
import { compareVersions, validate } from 'compare-versions'; import { compareVersions, validate } from 'compare-versions';
@ -371,25 +372,16 @@ export class UtilsService {
settings = JSON.parse((await Store.get(NC_APP_SETTINGS, true))?.value); settings = JSON.parse((await Store.get(NC_APP_SETTINGS, true))?.value);
} catch {} } catch {}
const oidcAuthEnabled = !!( const oidcAuthEnabled = ['openid', 'oidc'].includes(
process.env.NC_OIDC_ISSUER && process.env.NC_SSO?.toLowerCase(),
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 oidcProviderName = oidcAuthEnabled const oidcProviderName = oidcAuthEnabled
? process.env.NC_OIDC_PROVIDER_NAME ?? 'OpenID Connect' ? process.env.NC_OIDC_PROVIDER_NAME ?? 'OpenID Connect'
: null; : null;
const samlAuthEnabled = !!( const samlAuthEnabled = process.env.NC_SSO?.toLowerCase() === 'saml';
process.env.NC_SAML_ISSUER &&
process.env.NC_SAML_ENTRY_POINT &&
process.env.NC_SAML_CERT
);
const samlProviderName = samlAuthEnabled const samlProviderName = samlAuthEnabled
? process.env.NC_SAML_PROVIDER_NAME ?? 'SAML' ? process.env.NC_SSO_SAML_PROVIDER_NAME ?? 'SAML'
: null; : null;
const result = { const result = {

Loading…
Cancel
Save