mirror of
https://github.com/formbricks/formbricks.git
synced 2026-01-06 00:49:42 -06:00
22 lines
579 B
TypeScript
22 lines
579 B
TypeScript
"use server";
|
|
|
|
import { SAML_PRODUCT, SAML_TENANT } from "@/lib/constants";
|
|
import { actionClient } from "@/lib/utils/action-client";
|
|
import jackson from "@/modules/ee/auth/saml/lib/jackson";
|
|
|
|
export const doesSamlConnectionExistAction = actionClient.action(async () => {
|
|
const jacksonInstance = await jackson();
|
|
|
|
if (!jacksonInstance) {
|
|
return false;
|
|
}
|
|
|
|
const { connectionController } = jacksonInstance;
|
|
const connection = await connectionController.getConnections({
|
|
product: SAML_PRODUCT,
|
|
tenant: SAML_TENANT,
|
|
});
|
|
|
|
return connection.length === 1;
|
|
});
|