feat(core): Add SAML settings and consolidate LDAP under SSO (#5574)

* consolidate SSO settings

* update saml settings

* fix type error
This commit is contained in:
Michael Auerswald
2023-03-02 09:00:51 +01:00
committed by GitHub
parent f61d779667
commit 31cc8de829
12 changed files with 128 additions and 56 deletions

View File

@@ -1,7 +1,7 @@
import type { RequestHandler } from 'express';
import type { AuthenticatedRequest } from '../../../requests';
import { isSamlCurrentAuthenticationMethod } from '../../ssoHelpers';
import { isSamlEnabled, isSamlLicensed } from '../samlHelpers';
import { isSamlLoginEnabled, isSamlLicensed } from '../samlHelpers';
export const samlLicensedOwnerMiddleware: RequestHandler = (
req: AuthenticatedRequest,
@@ -16,7 +16,7 @@ export const samlLicensedOwnerMiddleware: RequestHandler = (
};
export const samlLicensedAndEnabledMiddleware: RequestHandler = (req, res, next) => {
if (isSamlEnabled() && isSamlLicensed() && isSamlCurrentAuthenticationMethod()) {
if (isSamlLoginEnabled() && isSamlLicensed() && isSamlCurrentAuthenticationMethod()) {
next();
} else {
res.status(401).json({ status: 'error', message: 'Unauthorized' });