Type improvements

This commit is contained in:
Daniel Hougaard
2024-03-13 13:37:59 +01:00
parent c9e5f2bb75
commit 0081bbdf9e

View File

@ -1,3 +1,4 @@
import { TOrganizations } from "@app/db/schemas";
import { UnauthorizedError } from "@app/lib/errors";
import { ActorAuthMethod, AuthMethod } from "@app/services/auth/auth-type";
@ -9,7 +10,7 @@ function isAuthMethodSaml(actorAuthMethod: ActorAuthMethod) {
);
}
function validateOrgSAML(actorAuthMethod: ActorAuthMethod, isSamlEnforced?: boolean | null) {
function validateOrgSAML(actorAuthMethod: ActorAuthMethod, isSamlEnforced: TOrganizations["authEnforced"]) {
if (actorAuthMethod === undefined) {
throw new UnauthorizedError({ name: "No auth method defined" });
}