diff --git a/src/utils/samlUtils.ts b/src/utils/samlUtils.ts index 3434a2a4..63a73d90 100644 --- a/src/utils/samlUtils.ts +++ b/src/utils/samlUtils.ts @@ -1092,22 +1092,19 @@ export const assertionValidation = ( () => new Error("Empty AuthnContextClassRef") ) ), + E.map(AuthnContextClassRef => + AuthnContextClassRef.textContent?.trim() + ), E.chain( E.fromPredicate( AuthnContextClassRef => - AuthnContextClassRef.textContent?.trim() === - SPID_LEVELS.SpidL1 || - AuthnContextClassRef.textContent?.trim() === - SPID_LEVELS.SpidL2 || - AuthnContextClassRef.textContent?.trim() === - SPID_LEVELS.SpidL3, + AuthnContextClassRef === SPID_LEVELS.SpidL1 || + AuthnContextClassRef === SPID_LEVELS.SpidL2 || + AuthnContextClassRef === SPID_LEVELS.SpidL3, () => new Error("Invalid AuthnContextClassRef value") ) ), - E.map(AuthnContextClassRef => - AuthnContextClassRef.textContent?.trim() - ), E.chain( E.fromPredicate( AuthnContextClassRef => {