Patch login with SAML when config is inactive

This commit is contained in:
Tuan Dang
2024-02-09 09:35:51 -08:00
parent a9a5e92358
commit 82181f078a
2 changed files with 11 additions and 3 deletions
+2 -1
View File
@@ -63,7 +63,8 @@ export const registerSamlRouter = async (server: FastifyZodProvider) => {
}
const ssoConfig = await server.services.saml.getSaml(ssoLookupDetails);
if (!ssoConfig) throw new BadRequestError({ message: "SSO config not found" });
if (!ssoConfig || !ssoConfig.isActive)
throw new BadRequestError({ message: "Failed to authenticate with SAML SSO" });
const samlConfig: TSAMLConfig = {
callbackUrl: `${appCfg.SITE_URL}/api/v1/sso/saml2/${samlConfigId}`,